haikuwebkit/Source/WTF/wtf/StackStats.cpp

279 lines
9.2 KiB
C++
Raw Permalink Normal View History

Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
/*
Remove remnants of support code for an upwards growing stack. https://bugs.webkit.org/show_bug.cgi?id=203942 Reviewed by Yusuke Suzuki. Source/JavaScriptCore: * runtime/VM.cpp: (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WTF: We haven't supported an upwards growing stack in years, and a lot of code has since been written specifically with only a downwards growing stack in mind (e.g. the LLInt, the JITs). Also, all our currently supported platforms use a downward growing stack. We should remove the remnants of support code for an upwards growing stack. The presence of that code is deceptive in that it conveys support for an upwards growing stack where this hasn't been the case in years. * wtf/StackBounds.cpp: (WTF::StackBounds::newThreadStackBounds): (WTF::StackBounds::currentThreadStackBoundsInternal): (WTF::StackBounds::stackDirection): Deleted. (WTF::testStackDirection2): Deleted. (WTF::testStackDirection): Deleted. * wtf/StackBounds.h: (WTF::StackBounds::size const): (WTF::StackBounds::contains const): (WTF::StackBounds::recursionLimit const): (WTF::StackBounds::StackBounds): (WTF::StackBounds::isGrowingDownwards const): (WTF::StackBounds::checkConsistency const): (WTF::StackBounds::isGrowingDownward const): Deleted. * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): Canonical link: https://commits.webkit.org/217281@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-11-07 07:27:52 +00:00
* Copyright (C) 2012-2019 Apple Inc. All rights reserved.
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#include <wtf/StackStats.h>
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
#if ENABLE(STACK_STATS)
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#include <wtf/Assertions.h>
#include <wtf/DataLog.h>
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
// Define the following flag if you want to collect stats on every single
// checkpoint. By default, we only log checkpoints that establish new
// max values.
#define ENABLE_VERBOSE_STACK_STATS 1
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
namespace WTF {
// CheckPoint management:
[WTF] Remove StaticLock https://bugs.webkit.org/show_bug.cgi?id=184332 Reviewed by Mark Lam. Source/JavaScriptCore: * API/JSValue.mm: (handerForStructTag): * API/JSVirtualMachine.mm: (+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]): (+[JSVMWrapperCache wrapperForJSContextGroupRef:]): * API/glib/JSCVirtualMachine.cpp: (addWrapper): (removeWrapper): * assembler/testmasm.cpp: * b3/air/testair.cpp: * b3/testb3.cpp: * bytecode/SuperSampler.cpp: * dfg/DFGCommon.cpp: * dfg/DFGCommonData.cpp: * dynbench.cpp: * heap/MachineStackMarker.cpp: (JSC::MachineThreads::tryCopyOtherThreadStacks): * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm: (Inspector::RemoteTargetHandleRunSourceGlobal): (Inspector::RemoteTargetQueueTaskOnGlobalQueue): * interpreter/CLoopStack.cpp: * parser/SourceProvider.cpp: * profiler/ProfilerDatabase.cpp: * profiler/ProfilerUID.cpp: (JSC::Profiler::UID::create): * runtime/IntlObject.cpp: (JSC::numberingSystemsForLocale): * runtime/JSLock.cpp: * runtime/JSLock.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::registerForReportAtExit): * runtime/VM.cpp: * wasm/WasmFaultSignalHandler.cpp: Source/WebCore: No behavior change. * Modules/webdatabase/Database.cpp: (WebCore::Database::Database): (WebCore::Database::performOpenAndVerify): (WebCore::Database::closeDatabase): (WebCore::Database::getCachedVersion const): (WebCore::Database::setCachedVersion): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::openDatabaseMutex): * Modules/webdatabase/DatabaseTracker.h: * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::allActiveWebSocketsMutex): * Modules/websockets/WebSocket.h: * bridge/objc/WebScriptObject.mm: * crypto/CryptoAlgorithmRegistry.cpp: (WebCore::CryptoAlgorithmRegistry::identifier): (WebCore::CryptoAlgorithmRegistry::name): (WebCore::CryptoAlgorithmRegistry::create): (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): * dom/Node.cpp: * platform/URL.cpp: * platform/graphics/FontCache.cpp: * platform/graphics/MediaPlayer.cpp: * platform/ios/QuickLook.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/wak/WebCoreThread.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/network/cf/LoaderRunLoopCF.cpp: (WebCore::loaderRunLoop): * platform/network/curl/CurlContext.cpp: (WebCore::CurlShareHandle::mutexFor): * platform/network/curl/CurlContext.h: * platform/sql/SQLiteDatabaseTracker.cpp: (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount): (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount): * platform/text/TextEncodingRegistry.cpp: (WebCore::buildBaseTextCodecMaps): (WebCore::newTextCodec): (WebCore::atomicCanonicalTextEncodingName): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThreadCount): (WebCore::WorkerThread::WorkerThread): (WebCore::WorkerThread::~WorkerThread): (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads): Source/WebKitLegacy/ios: * WebCoreSupport/WebFixedPositionContent.mm: Source/WebKitLegacy/mac: * DOM/DOMInternal.mm: (getDOMWrapper): (addDOMWrapper): (removeDOMWrapper): Source/WebKitLegacy/win: * WebKitQuartzCoreAdditions/CAView.cpp: (WKQCA::CAView::releaseAllD3DResources): * WebLocalizableStrings.cpp: Source/WTF: Now, WTF::StaticLock is `using StaticLock = Lock`. Lock just works in either static storage and dynamic storage. Remove StaticLock and always use Lock. We also remove StaticWordLock and StaticReadWriteLock. And we add WTF::RecursiveLock, which is RecursiveLockAdapter<Lock>. * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/Language.cpp: (WTF::userPreferredLanguages): * wtf/Lock.h: * wtf/MainThread.cpp: (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/ParkingLot.cpp: * wtf/ReadWriteLock.h: * wtf/RecursiveLockAdapter.h: * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/StackStats.h: * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/ThreadingPthreads.cpp: * wtf/ThreadingWin.cpp: * wtf/WordLock.h: * wtf/cf/LanguageCF.cpp: (WTF::languagePreferencesDidChange): (WTF::platformUserPreferredLanguages): * wtf/dtoa.cpp: * wtf/text/AtomicStringImpl.cpp: * wtf/text/StringView.cpp: (WTF::StringView::invalidate): (WTF::StringView::adoptUnderlyingString): (WTF::StringView::setUnderlyingString): * wtf/unicode/icu/CollatorICU.cpp: (WTF::Collator::Collator): (WTF::Collator::~Collator): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): Tools: * DumpRenderTree/JavaScriptThreading.cpp: Canonical link: https://commits.webkit.org/199887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-05 17:22:21 +00:00
Lock StackStats::s_sharedMutex;
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
StackStats::CheckPoint* StackStats::s_topCheckPoint = 0;
StackStats::LayoutCheckPoint* StackStats::s_firstLayoutCheckPoint = 0;
StackStats::LayoutCheckPoint* StackStats::s_topLayoutCheckPoint = 0;
// High watermark stats:
int StackStats::s_maxCheckPointDiff = 0;
int StackStats::s_maxStackHeight = 0;
int StackStats::s_maxReentryDepth = 0;
int StackStats::s_maxLayoutCheckPointDiff = 0;
int StackStats::s_maxTotalLayoutCheckPointDiff = 0;
int StackStats::s_maxLayoutReentryDepth = 0;
StackStats::PerThreadStats::PerThreadStats()
{
Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Source/JavaScriptCore: Use Thread::current() instead. * API/JSContext.mm: (+[JSContext currentContext]): (+[JSContext currentThis]): (+[JSContext currentCallee]): (+[JSContext currentArguments]): (-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]): (-[JSContext endCallbackWithData:]): * heap/Heap.cpp: (JSC::Heap::requestCollection): * runtime/Completion.cpp: (JSC::checkSyntax): (JSC::checkModuleSyntax): (JSC::evaluate): (JSC::loadAndEvaluateModule): (JSC::loadModule): (JSC::linkAndEvaluateModule): (JSC::importModule): * runtime/Identifier.cpp: (JSC::Identifier::checkCurrentAtomicStringTable): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::willReleaseLock): (JSC::JSLock::dropAllLocks): (JSC::JSLock::grabAllLocks): * runtime/JSLock.h: * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WebCore: Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WTF: We placed thread specific data in WTFThreadData previously. But now, we have a new good place to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread sometimes have the completely same fields (m_stack etc.) due to initialization order limitations. This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus, Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even before calling WTF::initializeThreading. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: * wtf/MainThread.h: * wtf/ParkingLot.cpp: * wtf/StackStats.cpp: (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/ThreadHolder.cpp: (WTF::ThreadHolder::initializeCurrent): * wtf/ThreadHolder.h: (WTF::ThreadHolder::ThreadHolder): (WTF::ThreadHolder::currentMayBeNull): (WTF::ThreadHolder::current): * wtf/ThreadHolderPthreads.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::destruct): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/ThreadHolderWin.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::currentDying): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/Threading.cpp: (WTF::Thread::initializeInThread): (WTF::Thread::entryPoint): (WTF::Thread::create): (WTF::Thread::didExit): (WTF::initializeThreading): (WTF::Thread::currentMayBeNull): Deleted. * wtf/Threading.h: (WTF::Thread::current): (WTF::Thread::atomicStringTable): (WTF::Thread::setCurrentAtomicStringTable): (WTF::Thread::stackStats): (WTF::Thread::savedStackPointerAtVMEntry): (WTF::Thread::setSavedStackPointerAtVMEntry): (WTF::Thread::savedLastStackTop): (WTF::Thread::setSavedLastStackTop): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/WTFThreadData.cpp: Removed. * wtf/WTFThreadData.h: Removed. * wtf/text/AtomicString.cpp: * wtf/text/AtomicStringImpl.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: (WTF::AtomicStringTable::create): * wtf/text/AtomicStringTable.h: Canonical link: https://commits.webkit.org/191874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-03 06:03:18 +00:00
const StackBounds& stack = Thread::current().stack();
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
m_reentryDepth = 0;
m_stackStart = (char*)stack.origin();
m_currentCheckPoint = 0;
Rename dataLog() and dataLogV() to dataLogF() and dataLogFV() https://bugs.webkit.org/show_bug.cgi?id=103001 Rubber stamped by Dan Bernstein. Source/JavaScriptCore: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithDisassembly): (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/LinkBuffer.h: (JSC): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::dumpChain): (JSC::CodeBlock::printGetByIdCacheStatus): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::resetStubInternal): (JSC::CodeBlock::reoptimize): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::tallyFrequentExitSites): (JSC::CodeBlock::dumpValueProfiles): * bytecode/Opcode.cpp: (JSC::OpcodeStats::~OpcodeStats): * bytecode/SamplingTool.cpp: (JSC::SamplingFlags::stop): (JSC::SamplingRegion::dumpInternal): (JSC::SamplingTool::dump): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): (JSC::DFG::AbstractState::mergeToSuccessors): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks): (JSC::DFG::ByteCodeParser::makeSafe): (JSC::DFG::ByteCodeParser::makeDivSafe): (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::processPhiStack): (JSC::DFG::ByteCodeParser::linkBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): (JSC::DFG::ByteCodeParser::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): (JSC::DFG::CFAPhase::performForwardCFA): * dfg/DFGCFGSimplificationPhase.cpp: (JSC::DFG::CFGSimplificationPhase::run): (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal): (JSC::DFG::CFGSimplificationPhase::fixPhis): (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors): (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference): (JSC::DFG::CFGSimplificationPhase::mergeBlocks): * dfg/DFGCSEPhase.cpp: (JSC::DFG::CSEPhase::endIndexForPureCSE): (JSC::DFG::CSEPhase::setReplacement): (JSC::DFG::CSEPhase::eliminate): (JSC::DFG::CSEPhase::performNodeCSE): * dfg/DFGCapabilities.cpp: (JSC::DFG::debugFail): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode): * dfg/DFGDisassembler.cpp: (JSC::DFG::Disassembler::dump): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixDoubleEdge): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOSRExitCompiler64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOperations.cpp: * dfg/DFGPhase.cpp: (JSC::DFG::Phase::beginPhase): * dfg/DFGPhase.h: (JSC::DFG::runAndLog): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): (JSC::DFG::PredictionPropagationPhase::propagateForward): (JSC::DFG::PredictionPropagationPhase::propagateBackward): (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::dump): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection): (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): * dfg/DFGValidate.cpp: (Validate): (JSC::DFG::Validate::reportValidationContext): (JSC::DFG::Validate::dumpData): (JSC::DFG::Validate::dumpGraphIfAppropriate): * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::logEvent): (JSC::DFG::VariableEventStream::reconstruct): * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * heap/Heap.cpp: * heap/HeapStatistics.cpp: (JSC::HeapStatistics::logStatistics): (JSC::HeapStatistics::showObjectStatistics): * heap/MarkStack.h: * heap/MarkedBlock.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::validate): * interpreter/CallFrame.cpp: (JSC::CallFrame::dumpCaller): * interpreter/Interpreter.cpp: (JSC::Interpreter::dumpRegisters): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITDisassembler.cpp: (JSC::JITDisassembler::dump): (JSC::JITDisassembler::dumpForInstructions): * jit/JITStubRoutine.h: (JSC): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * jit/JumpReplacementWatchpoint.cpp: (JSC::JumpReplacementWatchpoint::fireInternal): * llint/LLIntExceptions.cpp: (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::entryOSR): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): * profiler/Profile.cpp: (JSC::Profile::debugPrintData): (JSC::Profile::debugPrintDataSampleStyle): * profiler/ProfileNode.cpp: (JSC::ProfileNode::debugPrintData): (JSC::ProfileNode::debugPrintDataSampleStyle): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::dumpRegExpTrace): * runtime/RegExp.cpp: (JSC::RegExp::matchCompareWithInterpreter): * runtime/SamplingCounter.cpp: (JSC::AbstractSamplingCounter::dump): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No change in behavior, so no new tests. * platform/KURLWTFURL.cpp: (WebCore::KURL::print): Source/WTF: * wtf/DataLog.cpp: (WTF::dataLogFV): (WTF::dataLogF): (WTF::dataLogFString): * wtf/DataLog.h: (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::HashTable::Stats::dumpStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/StackStats.cpp: (WTF::StackStats::initialize): (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/text/WTFString.cpp: (String::show): Canonical link: https://commits.webkit.org/121130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-22 04:23:36 +00:00
dataLogF(" === THREAD new stackStart %p ========\n", m_stackStart);
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
}
StackStats::CheckPoint::CheckPoint()
{
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
Locker locker { StackStats::s_sharedMutex };
Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Source/JavaScriptCore: Use Thread::current() instead. * API/JSContext.mm: (+[JSContext currentContext]): (+[JSContext currentThis]): (+[JSContext currentCallee]): (+[JSContext currentArguments]): (-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]): (-[JSContext endCallbackWithData:]): * heap/Heap.cpp: (JSC::Heap::requestCollection): * runtime/Completion.cpp: (JSC::checkSyntax): (JSC::checkModuleSyntax): (JSC::evaluate): (JSC::loadAndEvaluateModule): (JSC::loadModule): (JSC::linkAndEvaluateModule): (JSC::importModule): * runtime/Identifier.cpp: (JSC::Identifier::checkCurrentAtomicStringTable): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::willReleaseLock): (JSC::JSLock::dropAllLocks): (JSC::JSLock::grabAllLocks): * runtime/JSLock.h: * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WebCore: Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WTF: We placed thread specific data in WTFThreadData previously. But now, we have a new good place to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread sometimes have the completely same fields (m_stack etc.) due to initialization order limitations. This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus, Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even before calling WTF::initializeThreading. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: * wtf/MainThread.h: * wtf/ParkingLot.cpp: * wtf/StackStats.cpp: (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/ThreadHolder.cpp: (WTF::ThreadHolder::initializeCurrent): * wtf/ThreadHolder.h: (WTF::ThreadHolder::ThreadHolder): (WTF::ThreadHolder::currentMayBeNull): (WTF::ThreadHolder::current): * wtf/ThreadHolderPthreads.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::destruct): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/ThreadHolderWin.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::currentDying): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/Threading.cpp: (WTF::Thread::initializeInThread): (WTF::Thread::entryPoint): (WTF::Thread::create): (WTF::Thread::didExit): (WTF::initializeThreading): (WTF::Thread::currentMayBeNull): Deleted. * wtf/Threading.h: (WTF::Thread::current): (WTF::Thread::atomicStringTable): (WTF::Thread::setCurrentAtomicStringTable): (WTF::Thread::stackStats): (WTF::Thread::savedStackPointerAtVMEntry): (WTF::Thread::setSavedStackPointerAtVMEntry): (WTF::Thread::savedLastStackTop): (WTF::Thread::setSavedLastStackTop): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/WTFThreadData.cpp: Removed. * wtf/WTFThreadData.h: Removed. * wtf/text/AtomicString.cpp: * wtf/text/AtomicStringImpl.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: (WTF::AtomicStringTable::create): * wtf/text/AtomicStringTable.h: Canonical link: https://commits.webkit.org/191874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-03 06:03:18 +00:00
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
bool needToLog = false;
char* current = reinterpret_cast<char*>(this);
char* last = reinterpret_cast<char*>(t.m_currentCheckPoint);
// If there was no previous checkpoint, measure from the start of the stack:
if (!last)
last = t.m_stackStart;
// Update the reentry depth stats:
t.m_reentryDepth++;
if (t.m_reentryDepth > StackStats::s_maxReentryDepth) {
StackStats::s_maxReentryDepth = t.m_reentryDepth;
needToLog = true;
}
// Update the stack height stats:
int height = t.m_stackStart - current;
if (height > StackStats::s_maxStackHeight) {
StackStats::s_maxStackHeight = height;
needToLog = true;
}
// Update the checkpoint diff stats:
int diff = last - current;
if (diff > StackStats::s_maxCheckPointDiff) {
StackStats::s_maxCheckPointDiff = diff;
needToLog = true;
}
// Push this checkpoint:
m_prev = t.m_currentCheckPoint;
t.m_currentCheckPoint = this;
#if ENABLE(VERBOSE_STACK_STATS)
needToLog = true; // always log.
#endif
// Log this checkpoint if needed:
if (needToLog)
Rename dataLog() and dataLogV() to dataLogF() and dataLogFV() https://bugs.webkit.org/show_bug.cgi?id=103001 Rubber stamped by Dan Bernstein. Source/JavaScriptCore: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithDisassembly): (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/LinkBuffer.h: (JSC): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::dumpChain): (JSC::CodeBlock::printGetByIdCacheStatus): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::resetStubInternal): (JSC::CodeBlock::reoptimize): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::tallyFrequentExitSites): (JSC::CodeBlock::dumpValueProfiles): * bytecode/Opcode.cpp: (JSC::OpcodeStats::~OpcodeStats): * bytecode/SamplingTool.cpp: (JSC::SamplingFlags::stop): (JSC::SamplingRegion::dumpInternal): (JSC::SamplingTool::dump): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): (JSC::DFG::AbstractState::mergeToSuccessors): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks): (JSC::DFG::ByteCodeParser::makeSafe): (JSC::DFG::ByteCodeParser::makeDivSafe): (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::processPhiStack): (JSC::DFG::ByteCodeParser::linkBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): (JSC::DFG::ByteCodeParser::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): (JSC::DFG::CFAPhase::performForwardCFA): * dfg/DFGCFGSimplificationPhase.cpp: (JSC::DFG::CFGSimplificationPhase::run): (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal): (JSC::DFG::CFGSimplificationPhase::fixPhis): (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors): (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference): (JSC::DFG::CFGSimplificationPhase::mergeBlocks): * dfg/DFGCSEPhase.cpp: (JSC::DFG::CSEPhase::endIndexForPureCSE): (JSC::DFG::CSEPhase::setReplacement): (JSC::DFG::CSEPhase::eliminate): (JSC::DFG::CSEPhase::performNodeCSE): * dfg/DFGCapabilities.cpp: (JSC::DFG::debugFail): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode): * dfg/DFGDisassembler.cpp: (JSC::DFG::Disassembler::dump): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixDoubleEdge): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOSRExitCompiler64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOperations.cpp: * dfg/DFGPhase.cpp: (JSC::DFG::Phase::beginPhase): * dfg/DFGPhase.h: (JSC::DFG::runAndLog): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): (JSC::DFG::PredictionPropagationPhase::propagateForward): (JSC::DFG::PredictionPropagationPhase::propagateBackward): (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::dump): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection): (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): * dfg/DFGValidate.cpp: (Validate): (JSC::DFG::Validate::reportValidationContext): (JSC::DFG::Validate::dumpData): (JSC::DFG::Validate::dumpGraphIfAppropriate): * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::logEvent): (JSC::DFG::VariableEventStream::reconstruct): * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * heap/Heap.cpp: * heap/HeapStatistics.cpp: (JSC::HeapStatistics::logStatistics): (JSC::HeapStatistics::showObjectStatistics): * heap/MarkStack.h: * heap/MarkedBlock.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::validate): * interpreter/CallFrame.cpp: (JSC::CallFrame::dumpCaller): * interpreter/Interpreter.cpp: (JSC::Interpreter::dumpRegisters): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITDisassembler.cpp: (JSC::JITDisassembler::dump): (JSC::JITDisassembler::dumpForInstructions): * jit/JITStubRoutine.h: (JSC): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * jit/JumpReplacementWatchpoint.cpp: (JSC::JumpReplacementWatchpoint::fireInternal): * llint/LLIntExceptions.cpp: (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::entryOSR): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): * profiler/Profile.cpp: (JSC::Profile::debugPrintData): (JSC::Profile::debugPrintDataSampleStyle): * profiler/ProfileNode.cpp: (JSC::ProfileNode::debugPrintData): (JSC::ProfileNode::debugPrintDataSampleStyle): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::dumpRegExpTrace): * runtime/RegExp.cpp: (JSC::RegExp::matchCompareWithInterpreter): * runtime/SamplingCounter.cpp: (JSC::AbstractSamplingCounter::dump): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No change in behavior, so no new tests. * platform/KURLWTFURL.cpp: (WebCore::KURL::print): Source/WTF: * wtf/DataLog.cpp: (WTF::dataLogFV): (WTF::dataLogF): (WTF::dataLogFString): * wtf/DataLog.h: (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::HashTable::Stats::dumpStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/StackStats.cpp: (WTF::StackStats::initialize): (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/text/WTFString.cpp: (String::show): Canonical link: https://commits.webkit.org/121130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-22 04:23:36 +00:00
dataLogF(" CHECKPOINT %p diff %d/%.1fk/max %.1fk | reentry %d/max %d | height %.1fk/max %.1fk | stack %p size %.1fk\n",
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
this, diff, diff / 1024.0, StackStats::s_maxCheckPointDiff / 1024.0,
t.m_reentryDepth, StackStats::s_maxReentryDepth,
height / 1024.0, StackStats::s_maxStackHeight / 1024.0,
stack.origin(), stack.size() / 1024.0);
}
StackStats::CheckPoint::~CheckPoint()
{
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
Locker locker { StackStats::s_sharedMutex };
Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Source/JavaScriptCore: Use Thread::current() instead. * API/JSContext.mm: (+[JSContext currentContext]): (+[JSContext currentThis]): (+[JSContext currentCallee]): (+[JSContext currentArguments]): (-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]): (-[JSContext endCallbackWithData:]): * heap/Heap.cpp: (JSC::Heap::requestCollection): * runtime/Completion.cpp: (JSC::checkSyntax): (JSC::checkModuleSyntax): (JSC::evaluate): (JSC::loadAndEvaluateModule): (JSC::loadModule): (JSC::linkAndEvaluateModule): (JSC::importModule): * runtime/Identifier.cpp: (JSC::Identifier::checkCurrentAtomicStringTable): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::willReleaseLock): (JSC::JSLock::dropAllLocks): (JSC::JSLock::grabAllLocks): * runtime/JSLock.h: * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WebCore: Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WTF: We placed thread specific data in WTFThreadData previously. But now, we have a new good place to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread sometimes have the completely same fields (m_stack etc.) due to initialization order limitations. This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus, Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even before calling WTF::initializeThreading. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: * wtf/MainThread.h: * wtf/ParkingLot.cpp: * wtf/StackStats.cpp: (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/ThreadHolder.cpp: (WTF::ThreadHolder::initializeCurrent): * wtf/ThreadHolder.h: (WTF::ThreadHolder::ThreadHolder): (WTF::ThreadHolder::currentMayBeNull): (WTF::ThreadHolder::current): * wtf/ThreadHolderPthreads.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::destruct): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/ThreadHolderWin.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::currentDying): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/Threading.cpp: (WTF::Thread::initializeInThread): (WTF::Thread::entryPoint): (WTF::Thread::create): (WTF::Thread::didExit): (WTF::initializeThreading): (WTF::Thread::currentMayBeNull): Deleted. * wtf/Threading.h: (WTF::Thread::current): (WTF::Thread::atomicStringTable): (WTF::Thread::setCurrentAtomicStringTable): (WTF::Thread::stackStats): (WTF::Thread::savedStackPointerAtVMEntry): (WTF::Thread::setSavedStackPointerAtVMEntry): (WTF::Thread::savedLastStackTop): (WTF::Thread::setSavedLastStackTop): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/WTFThreadData.cpp: Removed. * wtf/WTFThreadData.h: Removed. * wtf/text/AtomicString.cpp: * wtf/text/AtomicStringImpl.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: (WTF::AtomicStringTable::create): * wtf/text/AtomicStringTable.h: Canonical link: https://commits.webkit.org/191874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-03 06:03:18 +00:00
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
// Pop to previous checkpoint:
t.m_currentCheckPoint = m_prev;
--t.m_reentryDepth;
// Log this checkpoint if needed:
#if ENABLE(VERBOSE_STACK_STATS)
if (!m_prev) {
Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Source/JavaScriptCore: Use Thread::current() instead. * API/JSContext.mm: (+[JSContext currentContext]): (+[JSContext currentThis]): (+[JSContext currentCallee]): (+[JSContext currentArguments]): (-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]): (-[JSContext endCallbackWithData:]): * heap/Heap.cpp: (JSC::Heap::requestCollection): * runtime/Completion.cpp: (JSC::checkSyntax): (JSC::checkModuleSyntax): (JSC::evaluate): (JSC::loadAndEvaluateModule): (JSC::loadModule): (JSC::linkAndEvaluateModule): (JSC::importModule): * runtime/Identifier.cpp: (JSC::Identifier::checkCurrentAtomicStringTable): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::willReleaseLock): (JSC::JSLock::dropAllLocks): (JSC::JSLock::grabAllLocks): * runtime/JSLock.h: * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WebCore: Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WTF: We placed thread specific data in WTFThreadData previously. But now, we have a new good place to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread sometimes have the completely same fields (m_stack etc.) due to initialization order limitations. This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus, Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even before calling WTF::initializeThreading. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: * wtf/MainThread.h: * wtf/ParkingLot.cpp: * wtf/StackStats.cpp: (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/ThreadHolder.cpp: (WTF::ThreadHolder::initializeCurrent): * wtf/ThreadHolder.h: (WTF::ThreadHolder::ThreadHolder): (WTF::ThreadHolder::currentMayBeNull): (WTF::ThreadHolder::current): * wtf/ThreadHolderPthreads.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::destruct): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/ThreadHolderWin.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::currentDying): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/Threading.cpp: (WTF::Thread::initializeInThread): (WTF::Thread::entryPoint): (WTF::Thread::create): (WTF::Thread::didExit): (WTF::initializeThreading): (WTF::Thread::currentMayBeNull): Deleted. * wtf/Threading.h: (WTF::Thread::current): (WTF::Thread::atomicStringTable): (WTF::Thread::setCurrentAtomicStringTable): (WTF::Thread::stackStats): (WTF::Thread::savedStackPointerAtVMEntry): (WTF::Thread::setSavedStackPointerAtVMEntry): (WTF::Thread::savedLastStackTop): (WTF::Thread::setSavedLastStackTop): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/WTFThreadData.cpp: Removed. * wtf/WTFThreadData.h: Removed. * wtf/text/AtomicString.cpp: * wtf/text/AtomicStringImpl.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: (WTF::AtomicStringTable::create): * wtf/text/AtomicStringTable.h: Canonical link: https://commits.webkit.org/191874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-03 06:03:18 +00:00
const StackBounds& stack = thread.stack();
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
char* current = reinterpret_cast<char*>(this);
int height = t.m_stackStart - current;
Rename dataLog() and dataLogV() to dataLogF() and dataLogFV() https://bugs.webkit.org/show_bug.cgi?id=103001 Rubber stamped by Dan Bernstein. Source/JavaScriptCore: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithDisassembly): (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/LinkBuffer.h: (JSC): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::dumpChain): (JSC::CodeBlock::printGetByIdCacheStatus): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::resetStubInternal): (JSC::CodeBlock::reoptimize): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::tallyFrequentExitSites): (JSC::CodeBlock::dumpValueProfiles): * bytecode/Opcode.cpp: (JSC::OpcodeStats::~OpcodeStats): * bytecode/SamplingTool.cpp: (JSC::SamplingFlags::stop): (JSC::SamplingRegion::dumpInternal): (JSC::SamplingTool::dump): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): (JSC::DFG::AbstractState::mergeToSuccessors): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks): (JSC::DFG::ByteCodeParser::makeSafe): (JSC::DFG::ByteCodeParser::makeDivSafe): (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::processPhiStack): (JSC::DFG::ByteCodeParser::linkBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): (JSC::DFG::ByteCodeParser::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): (JSC::DFG::CFAPhase::performForwardCFA): * dfg/DFGCFGSimplificationPhase.cpp: (JSC::DFG::CFGSimplificationPhase::run): (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal): (JSC::DFG::CFGSimplificationPhase::fixPhis): (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors): (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference): (JSC::DFG::CFGSimplificationPhase::mergeBlocks): * dfg/DFGCSEPhase.cpp: (JSC::DFG::CSEPhase::endIndexForPureCSE): (JSC::DFG::CSEPhase::setReplacement): (JSC::DFG::CSEPhase::eliminate): (JSC::DFG::CSEPhase::performNodeCSE): * dfg/DFGCapabilities.cpp: (JSC::DFG::debugFail): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode): * dfg/DFGDisassembler.cpp: (JSC::DFG::Disassembler::dump): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixDoubleEdge): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOSRExitCompiler64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOperations.cpp: * dfg/DFGPhase.cpp: (JSC::DFG::Phase::beginPhase): * dfg/DFGPhase.h: (JSC::DFG::runAndLog): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): (JSC::DFG::PredictionPropagationPhase::propagateForward): (JSC::DFG::PredictionPropagationPhase::propagateBackward): (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::dump): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection): (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): * dfg/DFGValidate.cpp: (Validate): (JSC::DFG::Validate::reportValidationContext): (JSC::DFG::Validate::dumpData): (JSC::DFG::Validate::dumpGraphIfAppropriate): * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::logEvent): (JSC::DFG::VariableEventStream::reconstruct): * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * heap/Heap.cpp: * heap/HeapStatistics.cpp: (JSC::HeapStatistics::logStatistics): (JSC::HeapStatistics::showObjectStatistics): * heap/MarkStack.h: * heap/MarkedBlock.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::validate): * interpreter/CallFrame.cpp: (JSC::CallFrame::dumpCaller): * interpreter/Interpreter.cpp: (JSC::Interpreter::dumpRegisters): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITDisassembler.cpp: (JSC::JITDisassembler::dump): (JSC::JITDisassembler::dumpForInstructions): * jit/JITStubRoutine.h: (JSC): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * jit/JumpReplacementWatchpoint.cpp: (JSC::JumpReplacementWatchpoint::fireInternal): * llint/LLIntExceptions.cpp: (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::entryOSR): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): * profiler/Profile.cpp: (JSC::Profile::debugPrintData): (JSC::Profile::debugPrintDataSampleStyle): * profiler/ProfileNode.cpp: (JSC::ProfileNode::debugPrintData): (JSC::ProfileNode::debugPrintDataSampleStyle): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::dumpRegExpTrace): * runtime/RegExp.cpp: (JSC::RegExp::matchCompareWithInterpreter): * runtime/SamplingCounter.cpp: (JSC::AbstractSamplingCounter::dump): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No change in behavior, so no new tests. * platform/KURLWTFURL.cpp: (WebCore::KURL::print): Source/WTF: * wtf/DataLog.cpp: (WTF::dataLogFV): (WTF::dataLogF): (WTF::dataLogFString): * wtf/DataLog.h: (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::HashTable::Stats::dumpStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/StackStats.cpp: (WTF::StackStats::initialize): (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/text/WTFString.cpp: (String::show): Canonical link: https://commits.webkit.org/121130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-22 04:23:36 +00:00
dataLogF(" POP to %p diff max %.1fk | reentry %d/%d max | height %.1fk/max %.1fk | stack %p size %.1fk)\n",
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
this, StackStats::s_maxCheckPointDiff / 1024.0,
t.m_reentryDepth, StackStats::s_maxReentryDepth,
height / 1024.0, StackStats::s_maxStackHeight / 1024.0,
stack.origin(), stack.size() / 1024.0);
}
#endif
}
void StackStats::probe()
{
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
Locker locker { StackStats::s_sharedMutex };
Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Source/JavaScriptCore: Use Thread::current() instead. * API/JSContext.mm: (+[JSContext currentContext]): (+[JSContext currentThis]): (+[JSContext currentCallee]): (+[JSContext currentArguments]): (-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]): (-[JSContext endCallbackWithData:]): * heap/Heap.cpp: (JSC::Heap::requestCollection): * runtime/Completion.cpp: (JSC::checkSyntax): (JSC::checkModuleSyntax): (JSC::evaluate): (JSC::loadAndEvaluateModule): (JSC::loadModule): (JSC::linkAndEvaluateModule): (JSC::importModule): * runtime/Identifier.cpp: (JSC::Identifier::checkCurrentAtomicStringTable): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::willReleaseLock): (JSC::JSLock::dropAllLocks): (JSC::JSLock::grabAllLocks): * runtime/JSLock.h: * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WebCore: Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WTF: We placed thread specific data in WTFThreadData previously. But now, we have a new good place to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread sometimes have the completely same fields (m_stack etc.) due to initialization order limitations. This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus, Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even before calling WTF::initializeThreading. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: * wtf/MainThread.h: * wtf/ParkingLot.cpp: * wtf/StackStats.cpp: (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/ThreadHolder.cpp: (WTF::ThreadHolder::initializeCurrent): * wtf/ThreadHolder.h: (WTF::ThreadHolder::ThreadHolder): (WTF::ThreadHolder::currentMayBeNull): (WTF::ThreadHolder::current): * wtf/ThreadHolderPthreads.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::destruct): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/ThreadHolderWin.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::currentDying): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/Threading.cpp: (WTF::Thread::initializeInThread): (WTF::Thread::entryPoint): (WTF::Thread::create): (WTF::Thread::didExit): (WTF::initializeThreading): (WTF::Thread::currentMayBeNull): Deleted. * wtf/Threading.h: (WTF::Thread::current): (WTF::Thread::atomicStringTable): (WTF::Thread::setCurrentAtomicStringTable): (WTF::Thread::stackStats): (WTF::Thread::savedStackPointerAtVMEntry): (WTF::Thread::setSavedStackPointerAtVMEntry): (WTF::Thread::savedLastStackTop): (WTF::Thread::setSavedLastStackTop): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/WTFThreadData.cpp: Removed. * wtf/WTFThreadData.h: Removed. * wtf/text/AtomicString.cpp: * wtf/text/AtomicStringImpl.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: (WTF::AtomicStringTable::create): * wtf/text/AtomicStringTable.h: Canonical link: https://commits.webkit.org/191874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-03 06:03:18 +00:00
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
bool needToLog = false;
int dummy;
char* current = reinterpret_cast<char*>(&dummy);
char* last = reinterpret_cast<char*>(t.m_currentCheckPoint);
// If there was no previous checkpoint, measure from the start of the stack:
if (!last)
last = t.m_stackStart;
// We did not reach another checkpoint yet. Hence, we do not touch the
// reentry stats.
// Update the stack height stats:
int height = t.m_stackStart - current;
if (height > StackStats::s_maxStackHeight) {
StackStats::s_maxStackHeight = height;
needToLog = true;
}
// Update the checkpoint diff stats:
int diff = last - current;
if (diff > StackStats::s_maxCheckPointDiff) {
StackStats::s_maxCheckPointDiff = diff;
needToLog = true;
}
#if ENABLE(VERBOSE_STACK_STATS)
needToLog = true; // always log.
#endif
if (needToLog)
Rename dataLog() and dataLogV() to dataLogF() and dataLogFV() https://bugs.webkit.org/show_bug.cgi?id=103001 Rubber stamped by Dan Bernstein. Source/JavaScriptCore: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithDisassembly): (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/LinkBuffer.h: (JSC): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::dumpChain): (JSC::CodeBlock::printGetByIdCacheStatus): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::resetStubInternal): (JSC::CodeBlock::reoptimize): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::tallyFrequentExitSites): (JSC::CodeBlock::dumpValueProfiles): * bytecode/Opcode.cpp: (JSC::OpcodeStats::~OpcodeStats): * bytecode/SamplingTool.cpp: (JSC::SamplingFlags::stop): (JSC::SamplingRegion::dumpInternal): (JSC::SamplingTool::dump): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): (JSC::DFG::AbstractState::mergeToSuccessors): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks): (JSC::DFG::ByteCodeParser::makeSafe): (JSC::DFG::ByteCodeParser::makeDivSafe): (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::processPhiStack): (JSC::DFG::ByteCodeParser::linkBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): (JSC::DFG::ByteCodeParser::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): (JSC::DFG::CFAPhase::performForwardCFA): * dfg/DFGCFGSimplificationPhase.cpp: (JSC::DFG::CFGSimplificationPhase::run): (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal): (JSC::DFG::CFGSimplificationPhase::fixPhis): (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors): (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference): (JSC::DFG::CFGSimplificationPhase::mergeBlocks): * dfg/DFGCSEPhase.cpp: (JSC::DFG::CSEPhase::endIndexForPureCSE): (JSC::DFG::CSEPhase::setReplacement): (JSC::DFG::CSEPhase::eliminate): (JSC::DFG::CSEPhase::performNodeCSE): * dfg/DFGCapabilities.cpp: (JSC::DFG::debugFail): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode): * dfg/DFGDisassembler.cpp: (JSC::DFG::Disassembler::dump): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixDoubleEdge): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOSRExitCompiler64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOperations.cpp: * dfg/DFGPhase.cpp: (JSC::DFG::Phase::beginPhase): * dfg/DFGPhase.h: (JSC::DFG::runAndLog): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): (JSC::DFG::PredictionPropagationPhase::propagateForward): (JSC::DFG::PredictionPropagationPhase::propagateBackward): (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::dump): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection): (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): * dfg/DFGValidate.cpp: (Validate): (JSC::DFG::Validate::reportValidationContext): (JSC::DFG::Validate::dumpData): (JSC::DFG::Validate::dumpGraphIfAppropriate): * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::logEvent): (JSC::DFG::VariableEventStream::reconstruct): * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * heap/Heap.cpp: * heap/HeapStatistics.cpp: (JSC::HeapStatistics::logStatistics): (JSC::HeapStatistics::showObjectStatistics): * heap/MarkStack.h: * heap/MarkedBlock.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::validate): * interpreter/CallFrame.cpp: (JSC::CallFrame::dumpCaller): * interpreter/Interpreter.cpp: (JSC::Interpreter::dumpRegisters): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITDisassembler.cpp: (JSC::JITDisassembler::dump): (JSC::JITDisassembler::dumpForInstructions): * jit/JITStubRoutine.h: (JSC): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * jit/JumpReplacementWatchpoint.cpp: (JSC::JumpReplacementWatchpoint::fireInternal): * llint/LLIntExceptions.cpp: (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::entryOSR): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): * profiler/Profile.cpp: (JSC::Profile::debugPrintData): (JSC::Profile::debugPrintDataSampleStyle): * profiler/ProfileNode.cpp: (JSC::ProfileNode::debugPrintData): (JSC::ProfileNode::debugPrintDataSampleStyle): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::dumpRegExpTrace): * runtime/RegExp.cpp: (JSC::RegExp::matchCompareWithInterpreter): * runtime/SamplingCounter.cpp: (JSC::AbstractSamplingCounter::dump): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No change in behavior, so no new tests. * platform/KURLWTFURL.cpp: (WebCore::KURL::print): Source/WTF: * wtf/DataLog.cpp: (WTF::dataLogFV): (WTF::dataLogF): (WTF::dataLogFString): * wtf/DataLog.h: (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::HashTable::Stats::dumpStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/StackStats.cpp: (WTF::StackStats::initialize): (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/text/WTFString.cpp: (String::show): Canonical link: https://commits.webkit.org/121130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-22 04:23:36 +00:00
dataLogF(" PROBE %p diff %d/%.1fk/max %.1fk | reentry %d/max %d | height %.1fk/max %.1fk | stack %p size %.1fk\n",
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
current, diff, diff / 1024.0, StackStats::s_maxCheckPointDiff / 1024.0,
t.m_reentryDepth, StackStats::s_maxReentryDepth,
height / 1024.0, StackStats::s_maxStackHeight / 1024.0,
stack.origin(), stack.size() / 1024.0);
}
StackStats::LayoutCheckPoint::LayoutCheckPoint()
{
// While a layout checkpoint is not necessarily a checkpoint where we
// we will do a recursion check, it is a convenient spot for doing a
// probe to measure the height of stack usage.
//
// We'll do this probe before we commence with the layout checkpoint.
// This is because the probe also locks the sharedLock. By calling the
// probe first, we can avoid re-entering the lock.
StackStats::probe();
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
Locker locker { StackStats::s_sharedMutex };
Merge WTFThreadData to Thread::current https://bugs.webkit.org/show_bug.cgi?id=174716 Reviewed by Mark Lam. Source/JavaScriptCore: Use Thread::current() instead. * API/JSContext.mm: (+[JSContext currentContext]): (+[JSContext currentThis]): (+[JSContext currentCallee]): (+[JSContext currentArguments]): (-[JSContext beginCallbackWithData:calleeValue:thisValue:argumentCount:arguments:]): (-[JSContext endCallbackWithData:]): * heap/Heap.cpp: (JSC::Heap::requestCollection): * runtime/Completion.cpp: (JSC::checkSyntax): (JSC::checkModuleSyntax): (JSC::evaluate): (JSC::loadAndEvaluateModule): (JSC::loadModule): (JSC::linkAndEvaluateModule): (JSC::importModule): * runtime/Identifier.cpp: (JSC::Identifier::checkCurrentAtomicStringTable): * runtime/InitializeThreading.cpp: (JSC::initializeThreading): * runtime/JSLock.cpp: (JSC::JSLock::didAcquireLock): (JSC::JSLock::willReleaseLock): (JSC::JSLock::dropAllLocks): (JSC::JSLock::grabAllLocks): * runtime/JSLock.h: * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::updateStackLimits): (JSC::VM::committedStackByteCount): * runtime/VM.h: (JSC::VM::isSafeToRecurse const): * runtime/VMEntryScope.cpp: (JSC::VMEntryScope::VMEntryScope): * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::isSafeToRecurse const): Source/WebCore: Use Thread::current() instead. * fileapi/AsyncFileStream.cpp: * platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::ThreadGlobalData): * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/ios/wak/WebCoreThread.mm: (StartWebThread): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): Source/WTF: We placed thread specific data in WTFThreadData previously. But now, we have a new good place to put thread specific data: WTF::Thread. Before this patch, WTFThreadData and WTF::Thread sometimes have the completely same fields (m_stack etc.) due to initialization order limitations. This patch merges WTFThreadData to WTF::Thread. We apply WTFThreadData's initialization style to WTF::Thread. So, WTF::Thread's holder now uses fast TLS for darwin environment. Thus, Thread::current() access is now accelerated. And WTF::Thread::current() can be accessed even before calling WTF::initializeThreading. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: * wtf/MainThread.h: * wtf/ParkingLot.cpp: * wtf/StackStats.cpp: (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/ThreadHolder.cpp: (WTF::ThreadHolder::initializeCurrent): * wtf/ThreadHolder.h: (WTF::ThreadHolder::ThreadHolder): (WTF::ThreadHolder::currentMayBeNull): (WTF::ThreadHolder::current): * wtf/ThreadHolderPthreads.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::destruct): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/ThreadHolderWin.cpp: (WTF::ThreadHolder::initializeKey): (WTF::ThreadHolder::currentDying): (WTF::ThreadHolder::initialize): (WTF::ThreadHolder::initializeOnce): Deleted. (WTF::ThreadHolder::current): Deleted. * wtf/Threading.cpp: (WTF::Thread::initializeInThread): (WTF::Thread::entryPoint): (WTF::Thread::create): (WTF::Thread::didExit): (WTF::initializeThreading): (WTF::Thread::currentMayBeNull): Deleted. * wtf/Threading.h: (WTF::Thread::current): (WTF::Thread::atomicStringTable): (WTF::Thread::setCurrentAtomicStringTable): (WTF::Thread::stackStats): (WTF::Thread::savedStackPointerAtVMEntry): (WTF::Thread::setSavedStackPointerAtVMEntry): (WTF::Thread::savedLastStackTop): (WTF::Thread::setSavedLastStackTop): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/ThreadingWin.cpp: (WTF::Thread::createCurrentThread): (WTF::Thread::current): Deleted. * wtf/WTFThreadData.cpp: Removed. * wtf/WTFThreadData.h: Removed. * wtf/text/AtomicString.cpp: * wtf/text/AtomicStringImpl.cpp: (WTF::stringTable): * wtf/text/AtomicStringTable.cpp: (WTF::AtomicStringTable::create): * wtf/text/AtomicStringTable.h: Canonical link: https://commits.webkit.org/191874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-08-03 06:03:18 +00:00
Thread& thread = Thread::current();
StackStats::PerThreadStats& t = thread.stackStats();
const StackBounds& stack = thread.stack();
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
// Push this checkpoint:
m_prev = StackStats::s_topLayoutCheckPoint;
if (m_prev)
m_depth = m_prev->m_depth + 1;
else {
StackStats::s_firstLayoutCheckPoint = this;
m_depth = 0;
}
StackStats::s_topLayoutCheckPoint = this;
//
char* current = reinterpret_cast<char*>(this);
char* last = reinterpret_cast<char*>(m_prev);
char* root = reinterpret_cast<char*>(StackStats::s_firstLayoutCheckPoint);
bool needToLog = false;
int diff = last - current;
if (!last)
diff = 0;
int totalDiff = root - current;
if (!root)
totalDiff = 0;
// Update the stack height stats:
int height = t.m_stackStart - current;
if (height > StackStats::s_maxStackHeight) {
StackStats::s_maxStackHeight = height;
needToLog = true;
}
// Update the layout checkpoint diff stats:
if (diff > StackStats::s_maxLayoutCheckPointDiff) {
StackStats::s_maxLayoutCheckPointDiff = diff;
needToLog = true;
}
// Update the total layout checkpoint diff stats:
if (totalDiff > StackStats::s_maxTotalLayoutCheckPointDiff) {
StackStats::s_maxTotalLayoutCheckPointDiff = totalDiff;
needToLog = true;
}
#if ENABLE(VERBOSE_STACK_STATS)
needToLog = true; // always log.
#endif
if (needToLog)
Rename dataLog() and dataLogV() to dataLogF() and dataLogFV() https://bugs.webkit.org/show_bug.cgi?id=103001 Rubber stamped by Dan Bernstein. Source/JavaScriptCore: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithDisassembly): (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/LinkBuffer.h: (JSC): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::dumpChain): (JSC::CodeBlock::printGetByIdCacheStatus): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (JSC::CodeBlock::resetStubInternal): (JSC::CodeBlock::reoptimize): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::tallyFrequentExitSites): (JSC::CodeBlock::dumpValueProfiles): * bytecode/Opcode.cpp: (JSC::OpcodeStats::~OpcodeStats): * bytecode/SamplingTool.cpp: (JSC::SamplingFlags::stop): (JSC::SamplingRegion::dumpInternal): (JSC::SamplingTool::dump): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): (JSC::DFG::AbstractState::mergeToSuccessors): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGArgumentsSimplificationPhase.cpp: (JSC::DFG::ArgumentsSimplificationPhase::run): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks): (JSC::DFG::ByteCodeParser::makeSafe): (JSC::DFG::ByteCodeParser::makeDivSafe): (JSC::DFG::ByteCodeParser::handleCall): (JSC::DFG::ByteCodeParser::handleInlining): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::processPhiStack): (JSC::DFG::ByteCodeParser::linkBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): (JSC::DFG::ByteCodeParser::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): (JSC::DFG::CFAPhase::performForwardCFA): * dfg/DFGCFGSimplificationPhase.cpp: (JSC::DFG::CFGSimplificationPhase::run): (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal): (JSC::DFG::CFGSimplificationPhase::fixPhis): (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors): (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference): (JSC::DFG::CFGSimplificationPhase::mergeBlocks): * dfg/DFGCSEPhase.cpp: (JSC::DFG::CSEPhase::endIndexForPureCSE): (JSC::DFG::CSEPhase::setReplacement): (JSC::DFG::CSEPhase::eliminate): (JSC::DFG::CSEPhase::performNodeCSE): * dfg/DFGCapabilities.cpp: (JSC::DFG::debugFail): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode): * dfg/DFGDisassembler.cpp: (JSC::DFG::Disassembler::dump): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::fixDoubleEdge): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExitCompiler.cpp: * dfg/DFGOSRExitCompiler32_64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOSRExitCompiler64.cpp: (JSC::DFG::OSRExitCompiler::compileExit): * dfg/DFGOperations.cpp: * dfg/DFGPhase.cpp: (JSC::DFG::Phase::beginPhase): * dfg/DFGPhase.h: (JSC::DFG::runAndLog): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): (JSC::DFG::PredictionPropagationPhase::propagateForward): (JSC::DFG::PredictionPropagationPhase::propagateBackward): (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::dump): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution): (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection): (JSC::DFG::SpeculativeJIT::runSlowPathGenerators): (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): (JSC::DFG::SpeculativeJIT::checkGeneratedTypeForToInt32): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): (JSC::DFG::SpeculativeJIT::fillSpeculateCell): (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): * dfg/DFGStructureCheckHoistingPhase.cpp: (JSC::DFG::StructureCheckHoistingPhase::run): * dfg/DFGValidate.cpp: (Validate): (JSC::DFG::Validate::reportValidationContext): (JSC::DFG::Validate::dumpData): (JSC::DFG::Validate::dumpGraphIfAppropriate): * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::logEvent): (JSC::DFG::VariableEventStream::reconstruct): * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * heap/Heap.cpp: * heap/HeapStatistics.cpp: (JSC::HeapStatistics::logStatistics): (JSC::HeapStatistics::showObjectStatistics): * heap/MarkStack.h: * heap/MarkedBlock.h: * heap/SlotVisitor.cpp: (JSC::SlotVisitor::validate): * interpreter/CallFrame.cpp: (JSC::CallFrame::dumpCaller): * interpreter/Interpreter.cpp: (JSC::Interpreter::dumpRegisters): * jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): * jit/JITDisassembler.cpp: (JSC::JITDisassembler::dump): (JSC::JITDisassembler::dumpForInstructions): * jit/JITStubRoutine.h: (JSC): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * jit/JumpReplacementWatchpoint.cpp: (JSC::JumpReplacementWatchpoint::fireInternal): * llint/LLIntExceptions.cpp: (JSC::LLInt::interpreterThrowInCaller): (JSC::LLInt::returnToThrow): (JSC::LLInt::callToThrow): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::llint_trace_operand): (JSC::LLInt::llint_trace_value): (JSC::LLInt::LLINT_SLOW_PATH_DECL): (JSC::LLInt::traceFunctionPrologue): (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::entryOSR): (JSC::LLInt::handleHostCall): (JSC::LLInt::setUpCall): * profiler/Profile.cpp: (JSC::Profile::debugPrintData): (JSC::Profile::debugPrintDataSampleStyle): * profiler/ProfileNode.cpp: (JSC::ProfileNode::debugPrintData): (JSC::ProfileNode::debugPrintDataSampleStyle): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::dumpRegExpTrace): * runtime/RegExp.cpp: (JSC::RegExp::matchCompareWithInterpreter): * runtime/SamplingCounter.cpp: (JSC::AbstractSamplingCounter::dump): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No change in behavior, so no new tests. * platform/KURLWTFURL.cpp: (WebCore::KURL::print): Source/WTF: * wtf/DataLog.cpp: (WTF::dataLogFV): (WTF::dataLogF): (WTF::dataLogFString): * wtf/DataLog.h: (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::HashTable::Stats::dumpStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/StackStats.cpp: (WTF::StackStats::initialize): (WTF::StackStats::PerThreadStats::PerThreadStats): (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): * wtf/text/WTFString.cpp: (String::show): Canonical link: https://commits.webkit.org/121130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-22 04:23:36 +00:00
dataLogF(" LAYOUT %p diff %d/%.1fk/max %.1fk | reentry %d/max %d | height %.1fk/max %.1fk | stack %p size %.1fk\n",
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
current, diff, diff / 1024.0, StackStats::s_maxLayoutCheckPointDiff / 1024.0,
m_depth, StackStats::s_maxLayoutReentryDepth,
totalDiff / 1024.0, StackStats::s_maxTotalLayoutCheckPointDiff / 1024.0,
stack.origin(), stack.size() / 1024.0);
}
StackStats::LayoutCheckPoint::~LayoutCheckPoint()
{
Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis https://bugs.webkit.org/show_bug.cgi?id=226117 Reviewed by Darin Adler. Stop using holdLock() in WTF as it is not compatible with Clang thread safety analysis (WTF::CheckedLock) and use the Locker constructor instead. This is a step towards getting rid of holdLock() completely. * benchmarks/ConditionSpeedTest.cpp: * wtf/ConcurrentPtrHashSet.cpp: (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::containsImplSlow const): (WTF::ConcurrentPtrHashSet::sizeSlow const): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): * wtf/CountingLock.h: * wtf/HashTable.cpp: (WTF::HashTableStats::recordCollisionAtCount): (WTF::HashTableStats::dumpStats): * wtf/HashTable.h: (WTF::invalidateIterators): (WTF::addIterator): (WTF::removeIterator): * wtf/LockedPrintStream.cpp: (WTF::LockedPrintStream::vprintf): (WTF::LockedPrintStream::flush): * wtf/MetaAllocator.cpp: (WTF::MetaAllocatorHandle::~MetaAllocatorHandle): * wtf/MetaAllocator.h: (WTF::MetaAllocator::allocate): (WTF::MetaAllocator::currentStatistics): * wtf/ReadWriteLock.h: * wtf/StackShotProfiler.h: (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): * wtf/StackStats.cpp: (WTF::StackStats::CheckPoint::CheckPoint): (WTF::StackStats::CheckPoint::~CheckPoint): (WTF::StackStats::probe): (WTF::StackStats::LayoutCheckPoint::LayoutCheckPoint): (WTF::StackStats::LayoutCheckPoint::~LayoutCheckPoint): * wtf/ThreadGroup.cpp: (WTF::ThreadGroup::~ThreadGroup): (WTF::ThreadGroup::add): * wtf/ThreadMessage.cpp: (WTF::sendMessageScoped): * wtf/Threading.cpp: (WTF::Thread::didExit): (WTF::Thread::addToThreadGroup): (WTF::Thread::removeFromThreadGroup): (WTF::Thread::numberOfThreadGroups): * wtf/TimingScope.cpp: * wtf/WTFConfig.cpp: (WTF::Config::permanentlyFreeze): * wtf/WTFSemaphore.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::signal): (WTF::Thread::establishPlatformSpecificHandle): * wtf/threads/BinarySemaphore.cpp: (WTF::BinarySemaphore::signal): (WTF::BinarySemaphore::waitUntil): * wtf/threads/Signals.cpp: (WTF::SignalHandlers::add): (WTF::registerThreadForMachExceptionHandling): (WTF::activateSignalHandlersFor): * wtf/win/LanguageWin.cpp: (WTF::platformLanguage): * wtf/win/ThreadingWin.cpp: (WTF::Thread::changePriority): (WTF::Thread::waitForCompletion): (WTF::Thread::detach): (WTF::Thread::establishPlatformSpecificHandle): Canonical link: https://commits.webkit.org/238033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-22 00:11:37 +00:00
Locker locker { StackStats::s_sharedMutex };
Added WTF::StackStats mechanism. 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): Canonical link: https://commits.webkit.org/117874@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-19 20:09:36 +00:00
// Pop to the previous layout checkpoint:
StackStats::s_topLayoutCheckPoint = m_prev;
if (!m_depth)
StackStats::s_firstLayoutCheckPoint = 0;
}
} // namespace WTF
#endif // ENABLE(STACK_STATS)