haikuwebkit/Source/WTF/wtf/DataLog.h

77 lines
2.5 KiB
C
Raw Permalink Normal View History

It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* 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.
*/
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
#pragma once
It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
#include <stdarg.h>
It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
#include <stdio.h>
#include <wtf/PrintStream.h>
It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
#include <wtf/StdLibExtras.h>
namespace WTF {
WTF_EXPORT_PRIVATE PrintStream& dataFile();
Add ability to configure JSC options from a file https://bugs.webkit.org/show_bug.cgi?id=168914 Reviewed by Filip Pizlo. Added the ability to set options and DataLog file location via a configuration file. Source/JavaScriptCore: The configuration file is specified with the --configFile option to JSC or the JSC_configFile environment variable. The file format allows for options conditionally dependent on various attributes. Currently those attributes are the process name, parent process name and build type (Release or Debug). In this patch, the parent process type is not set. That will be set up in WebKit code with a follow up patch. Here is an example config file: logFile = "/tmp/jscLog.%pid.txt" jscOptions { dumpOptions = 2 } build == "Debug" { jscOptions { useConcurrentJIT = false dumpDisassembly = true } } build == "Release" && processName == "jsc" { jscOptions { asyncDisassembly = true } } Eliminated the prior options file code. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * jsc.cpp: (jscmain): * runtime/ConfigFile.cpp: Added. (JSC::ConfigFileScanner::ConfigFileScanner): (JSC::ConfigFileScanner::start): (JSC::ConfigFileScanner::lineNumber): (JSC::ConfigFileScanner::currentBuffer): (JSC::ConfigFileScanner::atFileEnd): (JSC::ConfigFileScanner::tryConsume): (JSC::ConfigFileScanner::tryConsumeString): (JSC::ConfigFileScanner::tryConsumeUpto): (JSC::ConfigFileScanner::fillBufferIfNeeded): (JSC::ConfigFileScanner::fillBuffer): (JSC::ConfigFile::ConfigFile): (JSC::ConfigFile::setProcessName): (JSC::ConfigFile::setParentProcessName): (JSC::ConfigFile::parse): * runtime/ConfigFile.h: Added. * runtime/Options.cpp: (JSC::Options::initialize): (JSC::Options::setOptions): * runtime/Options.h: Source/WTF: The pathname can include the printf style "%pid", which will be replaced with the current process id. * wtf/DataLog.cpp: (WTF::initializeLogFileOnce): (WTF::setDataFile): * wtf/DataLog.h: Canonical link: https://commits.webkit.org/185961@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-28 18:50:00 +00:00
WTF_EXPORT_PRIVATE void setDataFile(const char* path);
WTF_EXPORT_PRIVATE void setDataFile(std::unique_ptr<PrintStream>&&);
It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
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
WTF_EXPORT_PRIVATE void dataLogFV(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(1, 0);
WTF_EXPORT_PRIVATE void dataLogF(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
WTF_EXPORT_PRIVATE void dataLogFString(const char*);
It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
template<typename... Types>
Use dataLogIf more regularly https://bugs.webkit.org/show_bug.cgi?id=206332 Reviewed by Keith Miller. Source/JavaScriptCore: There is lots of code that reads if (Options::foobar()) dataLogLn("...") There are a couple of benefits to replacing those by dataLogLnIf(Options::foobar(), "..."): - Readability, by reducing the number of lines taken by logging - Less lines appearing as not-taken in test coverage wrongly (wrongly because we probably don't care for the coverage of logging code) - possibly a tiny perf benefit since dataLogIf correctly uses UNLIKELY. This patch is a fairly trivial refactoring where I looked for that pattern and replaced it everywhere it appeared in JSC. * bytecode/BytecodeGeneratorification.cpp: (JSC::performGeneratorification): * bytecode/BytecodeLivenessAnalysis.cpp: (JSC::BytecodeLivenessAnalysis::BytecodeLivenessAnalysis): * bytecode/CallLinkInfo.cpp: (JSC::CallLinkInfo::visitWeak): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finalizeLLIntInlineCaches): (JSC::CodeBlock::noticeIncomingCall): (JSC::CodeBlock::optimizationThresholdScalingFactor): (JSC::CodeBlock::optimizeNextInvocation): (JSC::CodeBlock::dontOptimizeAnytimeSoon): (JSC::CodeBlock::optimizeAfterWarmUp): (JSC::CodeBlock::optimizeAfterLongWarmUp): (JSC::CodeBlock::optimizeSoon): (JSC::CodeBlock::forceOptimizationSlowPathConcurrently): (JSC::CodeBlock::setOptimizationThresholdBasedOnCompilationResult): (JSC::CodeBlock::shouldOptimizeNow): * bytecode/DFGExitProfile.cpp: (JSC::DFG::ExitProfile::add): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseCodeBlock): * dfg/DFGCFAPhase.cpp: * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::optimizeNextInvocation): (JSC::DFG::JITCode::dontOptimizeAnytimeSoon): (JSC::DFG::JITCode::optimizeAfterWarmUp): (JSC::DFG::JITCode::optimizeSoon): (JSC::DFG::JITCode::forceOptimizationSlowPathConcurrently): (JSC::DFG::JITCode::setOSREntryBlock): * dfg/DFGJumpReplacement.cpp: (JSC::DFG::JumpReplacement::fire): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSRExit.cpp: (JSC::DFG::OSRExit::compileExit): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGOperations.cpp: * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGToFTLDeferredCompilationCallback.cpp: (JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously): (JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete): * dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp: (JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously): (JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidComplete): * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::completeAllReadyPlansForVM): * ftl/FTLOSREntry.cpp: (JSC::FTL::prepareOSREntry): * heap/Heap.cpp: (JSC::Heap::lastChanceToFinalize): (JSC::Heap::sweepSynchronously): (JSC::Heap::collectNow): (JSC::Heap::runBeginPhase): (JSC::Heap::runFixpointPhase): (JSC::Heap::runReloopPhase): (JSC::Heap::runEndPhase): (JSC::Heap::finalize): (JSC::Heap::willStartCollection): (JSC::Heap::updateAllocationLimits): (JSC::Heap::notifyIsSafeToCollect): * heap/MarkStackMergingConstraint.cpp: (JSC::MarkStackMergingConstraint::prepareToExecuteImpl): * heap/MarkedSpace.cpp: * heap/MarkingConstraint.cpp: (JSC::MarkingConstraint::prepareToExecute): * heap/MarkingConstraintSet.cpp: (JSC::MarkingConstraintSet::executeConvergence): (JSC::MarkingConstraintSet::executeConvergenceImpl): (JSC::MarkingConstraintSet::executeAll): * heap/MarkingConstraintSolver.cpp: (JSC::MarkingConstraintSolver::execute): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::appendToMarkStack): (JSC::SlotVisitor::visitChildren): (JSC::SlotVisitor::didRace): * heap/StochasticSpaceTimeMutatorScheduler.cpp: (JSC::StochasticSpaceTimeMutatorScheduler::beginCollection): (JSC::StochasticSpaceTimeMutatorScheduler::didExecuteConstraints): * jit/JIT.cpp: (JSC::JIT::link): * jit/JITExceptions.cpp: (JSC::genericUnwind): * jit/JITOperations.cpp: * jit/JITToDFGDeferredCompilationCallback.cpp: (JSC::JITToDFGDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously): (JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete): * jit/JITWorklist.cpp: (JSC::JITWorklist::Plan::finalize): * jit/PolymorphicCallStubRoutine.cpp: (JSC::PolymorphicCallNode::unlink): * jit/Repatch.cpp: (JSC::unlinkFor): (JSC::linkVirtualFor): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::jitCompileAndSetHeuristics): (JSC::LLInt::entryOSR): (JSC::LLInt::LLINT_SLOW_PATH_DECL): * parser/ModuleAnalyzer.cpp: (JSC::ModuleAnalyzer::analyze): * runtime/JSModuleLoader.cpp: (JSC::JSModuleLoader::importModule): (JSC::JSModuleLoader::resolveSync): (JSC::JSModuleLoader::fetch): (JSC::JSModuleLoader::evaluate): (JSC::moduleLoaderModuleDeclarationInstantiation): * runtime/ScriptExecutable.cpp: (JSC::ScriptExecutable::installCode): * runtime/VM.cpp: (JSC::VM::throwException): * tools/CompilerTimingScope.cpp: (JSC::CompilerTimingScope::CompilerTimingScope): (JSC::CompilerTimingScope::~CompilerTimingScope): * wasm/WasmMemory.cpp: * wasm/js/JSWebAssembly.cpp: (JSC::resolve): * yarr/YarrJIT.cpp: (JSC::Yarr::jitCompile): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPattern::compile): Source/WTF: * wtf/DataLog.h: (WTF::dataLog): Marked NEVER_INLINE, since it should never be perf-sensitive Canonical link: https://commits.webkit.org/219461@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-16 23:24:38 +00:00
NEVER_INLINE void dataLog(const Types&... values)
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
{
dataFile().print(values...);
fourthTier: DFG should have an SSA form for use by FTL https://bugs.webkit.org/show_bug.cgi?id=118338 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. Adds an SSA form to the DFG. We can convert ThreadedCPS form into SSA form after breaking critical edges. The conversion algorithm follows Aycock and Horspool, and the SSA form itself follows something I've done before, where instead of having Phi functions specify input nodes corresponding to block predecessors, we instead have Upsilon functions in the predecessors that specify which value in that block goes into which subsequent Phi. Upsilons don't have to dominate Phis (usually they don't) and they correspond to a non-SSA "mov" into the Phi's "variable". This gives all of the good properties of SSA, while ensuring that a bunch of CFG transformations don't have to be SSA-aware. So far the only DFG phases that are SSA-aware are DCE and CFA. CFG simplification is probably SSA-aware by default, though I haven't tried it. Constant folding probably needs a few tweaks, but is likely ready. Ditto for CSE, though it's not clear that we'd want to use block-local CSE when we could be doing GVN. Currently only the FTL can generate code from the SSA form, and there is no way to convert from SSA to ThreadedCPS or LoadStore. There probably will never be such a capability. In order to handle OSR exit state in the SSA, we place MovHints at Phi points. Other than that, you can reconstruct state-at-exit by forward propagating MovHints. Note that MovHint is the new SetLocal in SSA. SetLocal and GetLocal only survive into SSA if they are on captured variables, or in the case of flushes. A "live SetLocal" will be NodeMustGenerate and will always correspond to a flush. Computing the state-at-exit requires running SSA liveness analysis, OSR availability analysis, and flush liveness analysis. The FTL runs all of these prior to generating code. While OSR exit continues to be tricky, much of the logic is now factored into separate phases and the backend has to do less work to reason about what happened outside of the basic block that is being lowered. Conversion from DFG SSA to LLVM SSA is done by ensuring that we generate code in depth-first order, thus guaranteeing that a node will always be lowered (and hence have a LValue) before any of the blocks dominated by that node's block have code generated. For Upsilon/Phi, we just use alloca's. We could do something more clever there, but it's probably not worth it, at least not now. Finally, while the SSA form is currently only being converted to LLVM IR, there is nothing that prevents us from considering other backends in the future - with the caveat that this form is designed to be first lowered to a lower-level SSA before actual machine code generation commences. So we ought to either use LLVM (the intended path) or we will have to write our own SSA low-level backend. This runs all of the code that the FTL was known to run previously. No change in performance for now. But it does open some exciting possibilities! * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/Operands.h: (JSC::OperandValueTraits::dump): (JSC::Operands::fill): (Operands): (JSC::Operands::clear): (JSC::Operands::operator==): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::beginBasicBlock): (JSC::DFG::setLiveValues): (DFG): (JSC::DFG::AbstractState::initialize): (JSC::DFG::AbstractState::endBasicBlock): (JSC::DFG::AbstractState::executeEffects): (JSC::DFG::AbstractState::mergeStateAtTail): (JSC::DFG::AbstractState::merge): * dfg/DFGAbstractState.h: (AbstractState): * dfg/DFGAdjacencyList.h: (JSC::DFG::AdjacencyList::justOneChild): (AdjacencyList): * dfg/DFGBasicBlock.cpp: Added. (DFG): (JSC::DFG::BasicBlock::BasicBlock): (JSC::DFG::BasicBlock::~BasicBlock): (JSC::DFG::BasicBlock::ensureLocals): (JSC::DFG::BasicBlock::isInPhis): (JSC::DFG::BasicBlock::isInBlock): (JSC::DFG::BasicBlock::removePredecessor): (JSC::DFG::BasicBlock::replacePredecessor): (JSC::DFG::BasicBlock::dump): (JSC::DFG::BasicBlock::SSAData::SSAData): (JSC::DFG::BasicBlock::SSAData::~SSAData): * dfg/DFGBasicBlock.h: (BasicBlock): (JSC::DFG::BasicBlock::operator[]): (JSC::DFG::BasicBlock::successor): (JSC::DFG::BasicBlock::successorForCondition): (SSAData): * dfg/DFGBasicBlockInlines.h: (DFG): * dfg/DFGBlockInsertionSet.cpp: Added. (DFG): (JSC::DFG::BlockInsertionSet::BlockInsertionSet): (JSC::DFG::BlockInsertionSet::~BlockInsertionSet): (JSC::DFG::BlockInsertionSet::insert): (JSC::DFG::BlockInsertionSet::insertBefore): (JSC::DFG::BlockInsertionSet::execute): * dfg/DFGBlockInsertionSet.h: Added. (DFG): (BlockInsertionSet): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::run): * dfg/DFGCFGSimplificationPhase.cpp: * dfg/DFGCPSRethreadingPhase.cpp: (JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock): * dfg/DFGCommon.cpp: (WTF::printInternal): * dfg/DFGCommon.h: (JSC::DFG::doesKill): (DFG): (JSC::DFG::killStatusForDoesKill): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): (JSC::DFG::ConstantFoldingPhase::isCapturedAtOrAfter): * dfg/DFGCriticalEdgeBreakingPhase.cpp: Added. (DFG): (CriticalEdgeBreakingPhase): (JSC::DFG::CriticalEdgeBreakingPhase::CriticalEdgeBreakingPhase): (JSC::DFG::CriticalEdgeBreakingPhase::run): (JSC::DFG::CriticalEdgeBreakingPhase::breakCriticalEdge): (JSC::DFG::performCriticalEdgeBreaking): * dfg/DFGCriticalEdgeBreakingPhase.h: Added. (DFG): * dfg/DFGDCEPhase.cpp: (JSC::DFG::DCEPhase::run): (JSC::DFG::DCEPhase::findTypeCheckRoot): (JSC::DFG::DCEPhase::countNode): (DCEPhase): (JSC::DFG::DCEPhase::countEdge): (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren): * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGEdge.cpp: (JSC::DFG::Edge::dump): * dfg/DFGEdge.h: (JSC::DFG::Edge::Edge): (JSC::DFG::Edge::setNode): (JSC::DFG::Edge::useKindUnchecked): (JSC::DFG::Edge::setUseKind): (JSC::DFG::Edge::setProofStatus): (JSC::DFG::Edge::willNotHaveCheck): (JSC::DFG::Edge::willHaveCheck): (Edge): (JSC::DFG::Edge::killStatusUnchecked): (JSC::DFG::Edge::killStatus): (JSC::DFG::Edge::setKillStatus): (JSC::DFG::Edge::doesKill): (JSC::DFG::Edge::doesNotKill): (JSC::DFG::Edge::shift): (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGFlushFormat.cpp: Added. (WTF): (WTF::printInternal): * dfg/DFGFlushFormat.h: Added. (DFG): (JSC::DFG::resultFor): (JSC::DFG::useKindFor): (WTF): * dfg/DFGFlushLivenessAnalysisPhase.cpp: Added. (DFG): (FlushLivenessAnalysisPhase): (JSC::DFG::FlushLivenessAnalysisPhase::FlushLivenessAnalysisPhase): (JSC::DFG::FlushLivenessAnalysisPhase::run): (JSC::DFG::FlushLivenessAnalysisPhase::process): (JSC::DFG::FlushLivenessAnalysisPhase::setForNode): (JSC::DFG::FlushLivenessAnalysisPhase::flushFormat): (JSC::DFG::performFlushLivenessAnalysis): * dfg/DFGFlushLivenessAnalysisPhase.h: Added. (DFG): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::dumpBlockHeader): (DFG): (JSC::DFG::Graph::addForDepthFirstSort): (JSC::DFG::Graph::getBlocksInDepthFirstOrder): * dfg/DFGGraph.h: (JSC::DFG::Graph::convertToConstant): (JSC::DFG::Graph::valueProfileFor): (Graph): * dfg/DFGInsertionSet.h: (DFG): (JSC::DFG::InsertionSet::execute): * dfg/DFGLivenessAnalysisPhase.cpp: Added. (DFG): (LivenessAnalysisPhase): (JSC::DFG::LivenessAnalysisPhase::LivenessAnalysisPhase): (JSC::DFG::LivenessAnalysisPhase::run): (JSC::DFG::LivenessAnalysisPhase::process): (JSC::DFG::LivenessAnalysisPhase::addChildUse): (JSC::DFG::performLivenessAnalysis): * dfg/DFGLivenessAnalysisPhase.h: Added. (DFG): * dfg/DFGNode.cpp: (JSC::DFG::Node::hasVariableAccessData): (DFG): * dfg/DFGNode.h: (DFG): (Node): (JSC::DFG::Node::hasLocal): (JSC::DFG::Node::variableAccessData): (JSC::DFG::Node::hasPhi): (JSC::DFG::Node::phi): (JSC::DFG::Node::takenBlock): (JSC::DFG::Node::notTakenBlock): (JSC::DFG::Node::successor): (JSC::DFG::Node::successorForCondition): (JSC::DFG::nodeComparator): (JSC::DFG::nodeListDump): (JSC::DFG::nodeMapDump): * dfg/DFGNodeFlags.cpp: (JSC::DFG::dumpNodeFlags): * dfg/DFGNodeType.h: (DFG): * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: Added. (DFG): (OSRAvailabilityAnalysisPhase): (JSC::DFG::OSRAvailabilityAnalysisPhase::OSRAvailabilityAnalysisPhase): (JSC::DFG::OSRAvailabilityAnalysisPhase::run): (JSC::DFG::performOSRAvailabilityAnalysis): * dfg/DFGOSRAvailabilityAnalysisPhase.h: Added. (DFG): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPredictionInjectionPhase.cpp: (JSC::DFG::PredictionInjectionPhase::run): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): * dfg/DFGSSAConversionPhase.cpp: Added. (DFG): (SSAConversionPhase): (JSC::DFG::SSAConversionPhase::SSAConversionPhase): (JSC::DFG::SSAConversionPhase::run): (JSC::DFG::SSAConversionPhase::forwardPhiChildren): (JSC::DFG::SSAConversionPhase::forwardPhi): (JSC::DFG::SSAConversionPhase::forwardPhiEdge): (JSC::DFG::SSAConversionPhase::deduplicateChildren): (JSC::DFG::SSAConversionPhase::addFlushedLocalOp): (JSC::DFG::SSAConversionPhase::addFlushedLocalEdge): (JSC::DFG::performSSAConversion): * dfg/DFGSSAConversionPhase.h: Added. (DFG): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGValidate.cpp: (JSC::DFG::Validate::validate): (Validate): (JSC::DFG::Validate::validateCPS): * dfg/DFGVariableAccessData.h: (JSC::DFG::VariableAccessData::flushFormat): (VariableAccessData): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::lower): (JSC::FTL::LowerDFGToLLVM::createPhiVariables): (JSC::FTL::LowerDFGToLLVM::compileBlock): (JSC::FTL::LowerDFGToLLVM::compileNode): (JSC::FTL::LowerDFGToLLVM::compileUpsilon): (LowerDFGToLLVM): (JSC::FTL::LowerDFGToLLVM::compilePhi): (JSC::FTL::LowerDFGToLLVM::compileJSConstant): (JSC::FTL::LowerDFGToLLVM::compileWeakJSConstant): (JSC::FTL::LowerDFGToLLVM::compileGetArgument): (JSC::FTL::LowerDFGToLLVM::compileGetLocal): (JSC::FTL::LowerDFGToLLVM::compileSetLocal): (JSC::FTL::LowerDFGToLLVM::compileAdd): (JSC::FTL::LowerDFGToLLVM::compileArithSub): (JSC::FTL::LowerDFGToLLVM::compileArithMul): (JSC::FTL::LowerDFGToLLVM::compileArithDiv): (JSC::FTL::LowerDFGToLLVM::compileArithMod): (JSC::FTL::LowerDFGToLLVM::compileArithMinOrMax): (JSC::FTL::LowerDFGToLLVM::compileArithAbs): (JSC::FTL::LowerDFGToLLVM::compileArithNegate): (JSC::FTL::LowerDFGToLLVM::compileBitAnd): (JSC::FTL::LowerDFGToLLVM::compileBitOr): (JSC::FTL::LowerDFGToLLVM::compileBitXor): (JSC::FTL::LowerDFGToLLVM::compileBitRShift): (JSC::FTL::LowerDFGToLLVM::compileBitLShift): (JSC::FTL::LowerDFGToLLVM::compileBitURShift): (JSC::FTL::LowerDFGToLLVM::compileUInt32ToNumber): (JSC::FTL::LowerDFGToLLVM::compileInt32ToDouble): (JSC::FTL::LowerDFGToLLVM::compileGetButterfly): (JSC::FTL::LowerDFGToLLVM::compileGetArrayLength): (JSC::FTL::LowerDFGToLLVM::compileGetByVal): (JSC::FTL::LowerDFGToLLVM::compileGetByOffset): (JSC::FTL::LowerDFGToLLVM::compileGetGlobalVar): (JSC::FTL::LowerDFGToLLVM::compileCompareEqConstant): (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq): (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant): (JSC::FTL::LowerDFGToLLVM::compileCompareLess): (JSC::FTL::LowerDFGToLLVM::compileCompareLessEq): (JSC::FTL::LowerDFGToLLVM::compileCompareGreater): (JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq): (JSC::FTL::LowerDFGToLLVM::compileLogicalNot): (JSC::FTL::LowerDFGToLLVM::speculateBackward): (JSC::FTL::LowerDFGToLLVM::lowInt32): (JSC::FTL::LowerDFGToLLVM::lowCell): (JSC::FTL::LowerDFGToLLVM::lowBoolean): (JSC::FTL::LowerDFGToLLVM::lowDouble): (JSC::FTL::LowerDFGToLLVM::lowJSValue): (JSC::FTL::LowerDFGToLLVM::lowStorage): (JSC::FTL::LowerDFGToLLVM::speculate): (JSC::FTL::LowerDFGToLLVM::speculateBoolean): (JSC::FTL::LowerDFGToLLVM::isLive): (JSC::FTL::LowerDFGToLLVM::use): (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock): (JSC::FTL::LowerDFGToLLVM::appendOSRExit): (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall): (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode): (JSC::FTL::LowerDFGToLLVM::linkOSRExitsAndCompleteInitializationBlocks): (JSC::FTL::LowerDFGToLLVM::setInt32): (JSC::FTL::LowerDFGToLLVM::setJSValue): (JSC::FTL::LowerDFGToLLVM::setBoolean): (JSC::FTL::LowerDFGToLLVM::setStorage): (JSC::FTL::LowerDFGToLLVM::setDouble): (JSC::FTL::LowerDFGToLLVM::isValid): * ftl/FTLLoweredNodeValue.h: Added. (FTL): (LoweredNodeValue): (JSC::FTL::LoweredNodeValue::LoweredNodeValue): (JSC::FTL::LoweredNodeValue::isSet): (JSC::FTL::LoweredNodeValue::operator!): (JSC::FTL::LoweredNodeValue::value): (JSC::FTL::LoweredNodeValue::block): * ftl/FTLValueFromBlock.h: (JSC::FTL::ValueFromBlock::ValueFromBlock): (ValueFromBlock): * ftl/FTLValueSource.cpp: (JSC::FTL::ValueSource::dump): * ftl/FTLValueSource.h: Source/WTF: Reviewed by Mark Hahnenberg. - Extend variadicity of PrintStream and dataLog. - Give HashSet the ability to add a span of things. - Give HashSet the ability to == another HashSet. - Note FIXME's in HashTable concerning copying performance, that affects the way that the DFG now uses HashSets and HashMaps. - Factor out the bulk-insertion logic of JSC::DFG::InsertionSet into WTF::Insertion, so that it can be used in more places. - Create a dumper for lists and maps. * WTF.xcodeproj/project.pbxproj: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/HashSet.h: (HashSet): (WTF): (WTF::::add): (WTF::=): * wtf/HashTable.h: (WTF::::HashTable): (WTF::=): * wtf/Insertion.h: Added. (WTF): (Insertion): (WTF::Insertion::Insertion): (WTF::Insertion::index): (WTF::Insertion::element): (WTF::Insertion::operator<): (WTF::executeInsertions): * wtf/ListDump.h: Added. (WTF): (ListDump): (WTF::ListDump::ListDump): (WTF::ListDump::dump): (MapDump): (WTF::MapDump::MapDump): (WTF::MapDump::dump): (WTF::listDump): (WTF::sortedListDump): (WTF::lessThan): (WTF::mapDump): (WTF::sortedMapDump): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): Conflicts: Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj Canonical link: https://commits.webkit.org/137058@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:04:45 +00:00
}
Implement WASM Parser and B3 IR generator https://bugs.webkit.org/show_bug.cgi?id=160681 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This patch adds the skeleton for a WebAssembly pipeline. The pipeline is designed in order to make it easy to have as much of the compilation process threaded as possible. The flow of the pipeline roughly goes as follows: 1) Create a WASMPlan with the VM and a Vector of the assembly. Currently the plan will process all the work synchronously, however, in the future this can be offloaded to other threads. 2) The plan will run the WASMModuleParser, which collates all the information needed to compile each module function independently. Since, we are still in the early phases, the only information is the starting and ending byte of the function's body. The module parser, however, still scans both and semi-validates the type and the function sections. 3) Each function is decoded and compiled. In the future this should also include a opcode validation phase. The WASMFunctionParser is templatized so that a validator should be able to use most of the same code the B3 IR generator does. 4) When the plan has finished it will fill a Vector of B3::Compilation objects that correspond to the respective function in the WASM module. The current testing plan for the modules is to inline the the binary generated by the spec's OCaml prototype. The inlined binary is passed to a WASMPlan then invoked to check the result of the function. In the future we should add a more robust testing infrastructure. * JavaScriptCore.xcodeproj/project.pbxproj: * testWASM.cpp: (printUsageStatement): (CommandLine::parseArguments): (invoke): (runWASMTests): (main): * wasm/JSWASMModule.h: (JSC::JSWASMModule::globalVariableTypes): * wasm/WASMB3IRGenerator.cpp: Added. (JSC::WASM::B3IRGenerator::B3IRGenerator): (JSC::WASM::B3IRGenerator::addLocal): (JSC::WASM::B3IRGenerator::binaryOp): (JSC::WASM::B3IRGenerator::addConstant): (JSC::WASM::B3IRGenerator::addBlock): (JSC::WASM::B3IRGenerator::endBlock): (JSC::WASM::B3IRGenerator::addReturn): (JSC::WASM::B3IRGenerator::unify): (JSC::WASM::B3IRGenerator::initializeIncommingTypes): (JSC::WASM::B3IRGenerator::unifyValuesWithLevel): (JSC::WASM::B3IRGenerator::stackForControlLevel): (JSC::WASM::B3IRGenerator::blockForControlLevel): (JSC::WASM::parseAndCompile): * wasm/WASMB3IRGenerator.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMFormat.h: * wasm/WASMFunctionParser.h: Added. (JSC::WASM::WASMFunctionParser<Context>::WASMFunctionParser): (JSC::WASM::WASMFunctionParser<Context>::parse): (JSC::WASM::WASMFunctionParser<Context>::parseBlock): (JSC::WASM::WASMFunctionParser<Context>::parseExpression): * wasm/WASMModuleParser.cpp: Added. (JSC::WASM::WASMModuleParser::parse): (JSC::WASM::WASMModuleParser::parseFunctionTypes): (JSC::WASM::WASMModuleParser::parseFunctionSignatures): (JSC::WASM::WASMModuleParser::parseFunctionDefinitions): * wasm/WASMModuleParser.h: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMModuleParser::WASMModuleParser): (JSC::WASM::WASMModuleParser::functionInformation): * wasm/WASMOps.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMParser.h: Added. (JSC::WASM::WASMParser::parseVarUInt32): (JSC::WASM::WASMParser::WASMParser): (JSC::WASM::WASMParser::consumeCharacter): (JSC::WASM::WASMParser::consumeString): (JSC::WASM::WASMParser::parseUInt32): (JSC::WASM::WASMParser::parseUInt7): (JSC::WASM::WASMParser::parseVarUInt1): (JSC::WASM::WASMParser::parseValueType): * wasm/WASMPlan.cpp: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::Plan::Plan): * wasm/WASMPlan.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMSections.cpp: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMSections::lookup): * wasm/WASMSections.h: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMSections::validateOrder): Source/WTF: * wtf/DataLog.h: (WTF::dataLogLn): Add a new dataLog function, dataLogLn that automagically includes a new line at the end of the print. * wtf/LEBDecoder.h: (decodeUInt32): (decodeInt32): Change the LEBDecoder to take a pointer and length rather than a Vector. Canonical link: https://commits.webkit.org/178982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-15 21:35:07 +00:00
template<typename... Types>
void dataLogLn(const Types&... values)
{
WASM should support faster loads. https://bugs.webkit.org/show_bug.cgi?id=162693 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds support for WebAssembly using a 32-bit address space for memory (along with some extra space for offset overflow). With a 32-bit address space (we call them Signaling/fast memories), we reserve the virtual address space for 2^32 + offset bytes of memory and only mark the usable section as read/write. If wasm code would read/write out of bounds we use a custom signal handler to catch the SIGBUS. The signal handler then checks if the faulting instruction is wasm code and tells the thread to resume executing from the wasm exception handler. Otherwise, the signal handler crashes the process, as usual. All of the allocations of these memories are managed by the Wasm::Memory class. In order to avoid TLB churn in the OS we cache old Signaling memories that are no longer in use. Since getting the wrong memory can cause recompiles, we try to reserve a memory for modules that do not import a memory. If a module does import a memory, we try to guess the type of memory we are going to get based on the last one allocated. This patch also changes how the wasm JS-api manages objects. Since we can compile different versions of code, this patch adds a new JSWebAssemblyCodeBlock class that holds all the information specific to running a module in a particular bounds checking mode. Additionally, the Wasm::Memory object is now a reference counted class that is shared between the JSWebAssemblyMemory object and the ArrayBuffer that also views it. * JavaScriptCore.xcodeproj/project.pbxproj: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): * jit/JITThunks.h: * jsc.cpp: (jscmain): * runtime/Options.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * wasm/JSWebAssemblyCodeBlock.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h. (JSC::JSWebAssemblyCodeBlock::create): (JSC::JSWebAssemblyCodeBlock::createStructure): (JSC::JSWebAssemblyCodeBlock::functionImportCount): (JSC::JSWebAssemblyCodeBlock::mode): (JSC::JSWebAssemblyCodeBlock::module): (JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::callees): (JSC::JSWebAssemblyCodeBlock::offsetOfCallees): (JSC::JSWebAssemblyCodeBlock::allocationSize): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): (JSC::Wasm::getMemoryBaseAndSize): (JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer): (JSC::Wasm::B3IRGenerator::emitLoadOp): (JSC::Wasm::B3IRGenerator::emitStoreOp): * wasm/WasmCallingConvention.h: * wasm/WasmFaultSignalHandler.cpp: Added. (JSC::Wasm::trapHandler): (JSC::Wasm::registerCode): (JSC::Wasm::unregisterCode): (JSC::Wasm::fastMemoryEnabled): (JSC::Wasm::enableFastMemory): * wasm/WasmFaultSignalHandler.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp. * wasm/WasmFormat.h: (JSC::Wasm::ModuleInformation::importFunctionCount): (JSC::Wasm::ModuleInformation::hasMemory): Deleted. * wasm/WasmMemory.cpp: (JSC::Wasm::mmapBytes): (JSC::Wasm::Memory::lastAllocatedMode): (JSC::Wasm::availableFastMemories): (JSC::Wasm::tryGetFastMemory): (JSC::Wasm::releaseFastMemory): (JSC::Wasm::Memory::Memory): (JSC::Wasm::Memory::createImpl): (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::grow): (JSC::Wasm::Memory::dump): (JSC::Wasm::Memory::makeString): * wasm/WasmMemory.h: (JSC::Wasm::Memory::operator bool): (JSC::Wasm::Memory::size): (JSC::Wasm::Memory::check): (JSC::Wasm::Memory::Memory): Deleted. (JSC::Wasm::Memory::offsetOfMemory): Deleted. (JSC::Wasm::Memory::offsetOfSize): Deleted. * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::MemoryInformation::MemoryInformation): * wasm/WasmMemoryInformation.h: (JSC::Wasm::MemoryInformation::hasReservedMemory): (JSC::Wasm::MemoryInformation::takeReservedMemory): (JSC::Wasm::MemoryInformation::mode): * wasm/WasmModuleParser.cpp: * wasm/WasmModuleParser.h: (JSC::Wasm::ModuleParser::ModuleParser): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::parseAndValidateModule): (JSC::Wasm::Plan::run): * wasm/WasmPlan.h: (JSC::Wasm::Plan::mode): * wasm/js/JSWebAssemblyCallee.cpp: (JSC::JSWebAssemblyCallee::finishCreation): (JSC::JSWebAssemblyCallee::destroy): * wasm/js/JSWebAssemblyCodeBlock.cpp: Added. (JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock): (JSC::JSWebAssemblyCodeBlock::destroy): (JSC::JSWebAssemblyCodeBlock::isSafeToRun): (JSC::JSWebAssemblyCodeBlock::visitChildren): (JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::setMemory): (JSC::JSWebAssemblyInstance::finishCreation): (JSC::JSWebAssemblyInstance::visitChildren): * wasm/js/JSWebAssemblyInstance.h: (JSC::JSWebAssemblyInstance::module): (JSC::JSWebAssemblyInstance::codeBlock): (JSC::JSWebAssemblyInstance::memoryMode): (JSC::JSWebAssemblyInstance::setMemory): Deleted. * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::create): (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory): (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): (JSC::JSWebAssemblyMemory::destroy): * wasm/js/JSWebAssemblyMemory.h: (JSC::JSWebAssemblyMemory::memory): (JSC::JSWebAssemblyMemory::offsetOfMemory): (JSC::JSWebAssemblyMemory::offsetOfSize): * wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::buildCodeBlock): (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::JSWebAssemblyModule): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::finishCreation): (JSC::JSWebAssemblyModule::visitChildren): (JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally): Deleted. * wasm/js/JSWebAssemblyModule.h: (JSC::JSWebAssemblyModule::takeReservedMemory): (JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::functionImportCount): Deleted. (JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::setJSEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::setWasmEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::callees): Deleted. (JSC::JSWebAssemblyModule::offsetOfCallees): Deleted. (JSC::JSWebAssemblyModule::allocationSize): Deleted. * wasm/js/WebAssemblyFunction.cpp: (JSC::callWebAssemblyFunction): * wasm/js/WebAssemblyInstanceConstructor.cpp: (JSC::constructJSWebAssemblyInstance): * wasm/js/WebAssemblyMemoryConstructor.cpp: (JSC::constructJSWebAssemblyMemory): * wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): (JSC::WebAssemblyModuleRecord::evaluate): Source/WTF: Add new forms of dataLog that take a boolean which describes if the log should happen. This makes cases where we have a static const bool for printing nicer since you can do: dataLogIf(verbose, things, to, print); instead of: if (verbose) dataLog(things, to, print); Also, add a operator! to Ref that has the same semantics as C++ refs. * wtf/DataLog.h: (WTF::dataLogLn): (WTF::dataLogIf): (WTF::dataLogLnIf): * wtf/Ref.h: (WTF::Ref::operator!): Canonical link: https://commits.webkit.org/186166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-03 22:24:21 +00:00
dataLog(values..., "\n");
}
template<typename... Types>
ALWAYS_INLINE void dataLogIf(bool shouldLog, const Types&... values)
WASM should support faster loads. https://bugs.webkit.org/show_bug.cgi?id=162693 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds support for WebAssembly using a 32-bit address space for memory (along with some extra space for offset overflow). With a 32-bit address space (we call them Signaling/fast memories), we reserve the virtual address space for 2^32 + offset bytes of memory and only mark the usable section as read/write. If wasm code would read/write out of bounds we use a custom signal handler to catch the SIGBUS. The signal handler then checks if the faulting instruction is wasm code and tells the thread to resume executing from the wasm exception handler. Otherwise, the signal handler crashes the process, as usual. All of the allocations of these memories are managed by the Wasm::Memory class. In order to avoid TLB churn in the OS we cache old Signaling memories that are no longer in use. Since getting the wrong memory can cause recompiles, we try to reserve a memory for modules that do not import a memory. If a module does import a memory, we try to guess the type of memory we are going to get based on the last one allocated. This patch also changes how the wasm JS-api manages objects. Since we can compile different versions of code, this patch adds a new JSWebAssemblyCodeBlock class that holds all the information specific to running a module in a particular bounds checking mode. Additionally, the Wasm::Memory object is now a reference counted class that is shared between the JSWebAssemblyMemory object and the ArrayBuffer that also views it. * JavaScriptCore.xcodeproj/project.pbxproj: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): * jit/JITThunks.h: * jsc.cpp: (jscmain): * runtime/Options.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * wasm/JSWebAssemblyCodeBlock.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h. (JSC::JSWebAssemblyCodeBlock::create): (JSC::JSWebAssemblyCodeBlock::createStructure): (JSC::JSWebAssemblyCodeBlock::functionImportCount): (JSC::JSWebAssemblyCodeBlock::mode): (JSC::JSWebAssemblyCodeBlock::module): (JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::callees): (JSC::JSWebAssemblyCodeBlock::offsetOfCallees): (JSC::JSWebAssemblyCodeBlock::allocationSize): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): (JSC::Wasm::getMemoryBaseAndSize): (JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer): (JSC::Wasm::B3IRGenerator::emitLoadOp): (JSC::Wasm::B3IRGenerator::emitStoreOp): * wasm/WasmCallingConvention.h: * wasm/WasmFaultSignalHandler.cpp: Added. (JSC::Wasm::trapHandler): (JSC::Wasm::registerCode): (JSC::Wasm::unregisterCode): (JSC::Wasm::fastMemoryEnabled): (JSC::Wasm::enableFastMemory): * wasm/WasmFaultSignalHandler.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp. * wasm/WasmFormat.h: (JSC::Wasm::ModuleInformation::importFunctionCount): (JSC::Wasm::ModuleInformation::hasMemory): Deleted. * wasm/WasmMemory.cpp: (JSC::Wasm::mmapBytes): (JSC::Wasm::Memory::lastAllocatedMode): (JSC::Wasm::availableFastMemories): (JSC::Wasm::tryGetFastMemory): (JSC::Wasm::releaseFastMemory): (JSC::Wasm::Memory::Memory): (JSC::Wasm::Memory::createImpl): (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::grow): (JSC::Wasm::Memory::dump): (JSC::Wasm::Memory::makeString): * wasm/WasmMemory.h: (JSC::Wasm::Memory::operator bool): (JSC::Wasm::Memory::size): (JSC::Wasm::Memory::check): (JSC::Wasm::Memory::Memory): Deleted. (JSC::Wasm::Memory::offsetOfMemory): Deleted. (JSC::Wasm::Memory::offsetOfSize): Deleted. * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::MemoryInformation::MemoryInformation): * wasm/WasmMemoryInformation.h: (JSC::Wasm::MemoryInformation::hasReservedMemory): (JSC::Wasm::MemoryInformation::takeReservedMemory): (JSC::Wasm::MemoryInformation::mode): * wasm/WasmModuleParser.cpp: * wasm/WasmModuleParser.h: (JSC::Wasm::ModuleParser::ModuleParser): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::parseAndValidateModule): (JSC::Wasm::Plan::run): * wasm/WasmPlan.h: (JSC::Wasm::Plan::mode): * wasm/js/JSWebAssemblyCallee.cpp: (JSC::JSWebAssemblyCallee::finishCreation): (JSC::JSWebAssemblyCallee::destroy): * wasm/js/JSWebAssemblyCodeBlock.cpp: Added. (JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock): (JSC::JSWebAssemblyCodeBlock::destroy): (JSC::JSWebAssemblyCodeBlock::isSafeToRun): (JSC::JSWebAssemblyCodeBlock::visitChildren): (JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::setMemory): (JSC::JSWebAssemblyInstance::finishCreation): (JSC::JSWebAssemblyInstance::visitChildren): * wasm/js/JSWebAssemblyInstance.h: (JSC::JSWebAssemblyInstance::module): (JSC::JSWebAssemblyInstance::codeBlock): (JSC::JSWebAssemblyInstance::memoryMode): (JSC::JSWebAssemblyInstance::setMemory): Deleted. * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::create): (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory): (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): (JSC::JSWebAssemblyMemory::destroy): * wasm/js/JSWebAssemblyMemory.h: (JSC::JSWebAssemblyMemory::memory): (JSC::JSWebAssemblyMemory::offsetOfMemory): (JSC::JSWebAssemblyMemory::offsetOfSize): * wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::buildCodeBlock): (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::JSWebAssemblyModule): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::finishCreation): (JSC::JSWebAssemblyModule::visitChildren): (JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally): Deleted. * wasm/js/JSWebAssemblyModule.h: (JSC::JSWebAssemblyModule::takeReservedMemory): (JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::functionImportCount): Deleted. (JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::setJSEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::setWasmEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::callees): Deleted. (JSC::JSWebAssemblyModule::offsetOfCallees): Deleted. (JSC::JSWebAssemblyModule::allocationSize): Deleted. * wasm/js/WebAssemblyFunction.cpp: (JSC::callWebAssemblyFunction): * wasm/js/WebAssemblyInstanceConstructor.cpp: (JSC::constructJSWebAssemblyInstance): * wasm/js/WebAssemblyMemoryConstructor.cpp: (JSC::constructJSWebAssemblyMemory): * wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): (JSC::WebAssemblyModuleRecord::evaluate): Source/WTF: Add new forms of dataLog that take a boolean which describes if the log should happen. This makes cases where we have a static const bool for printing nicer since you can do: dataLogIf(verbose, things, to, print); instead of: if (verbose) dataLog(things, to, print); Also, add a operator! to Ref that has the same semantics as C++ refs. * wtf/DataLog.h: (WTF::dataLogLn): (WTF::dataLogIf): (WTF::dataLogLnIf): * wtf/Ref.h: (WTF::Ref::operator!): Canonical link: https://commits.webkit.org/186166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-03 22:24:21 +00:00
{
if (UNLIKELY(shouldLog))
WASM should support faster loads. https://bugs.webkit.org/show_bug.cgi?id=162693 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds support for WebAssembly using a 32-bit address space for memory (along with some extra space for offset overflow). With a 32-bit address space (we call them Signaling/fast memories), we reserve the virtual address space for 2^32 + offset bytes of memory and only mark the usable section as read/write. If wasm code would read/write out of bounds we use a custom signal handler to catch the SIGBUS. The signal handler then checks if the faulting instruction is wasm code and tells the thread to resume executing from the wasm exception handler. Otherwise, the signal handler crashes the process, as usual. All of the allocations of these memories are managed by the Wasm::Memory class. In order to avoid TLB churn in the OS we cache old Signaling memories that are no longer in use. Since getting the wrong memory can cause recompiles, we try to reserve a memory for modules that do not import a memory. If a module does import a memory, we try to guess the type of memory we are going to get based on the last one allocated. This patch also changes how the wasm JS-api manages objects. Since we can compile different versions of code, this patch adds a new JSWebAssemblyCodeBlock class that holds all the information specific to running a module in a particular bounds checking mode. Additionally, the Wasm::Memory object is now a reference counted class that is shared between the JSWebAssemblyMemory object and the ArrayBuffer that also views it. * JavaScriptCore.xcodeproj/project.pbxproj: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): * jit/JITThunks.h: * jsc.cpp: (jscmain): * runtime/Options.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * wasm/JSWebAssemblyCodeBlock.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h. (JSC::JSWebAssemblyCodeBlock::create): (JSC::JSWebAssemblyCodeBlock::createStructure): (JSC::JSWebAssemblyCodeBlock::functionImportCount): (JSC::JSWebAssemblyCodeBlock::mode): (JSC::JSWebAssemblyCodeBlock::module): (JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::callees): (JSC::JSWebAssemblyCodeBlock::offsetOfCallees): (JSC::JSWebAssemblyCodeBlock::allocationSize): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): (JSC::Wasm::getMemoryBaseAndSize): (JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer): (JSC::Wasm::B3IRGenerator::emitLoadOp): (JSC::Wasm::B3IRGenerator::emitStoreOp): * wasm/WasmCallingConvention.h: * wasm/WasmFaultSignalHandler.cpp: Added. (JSC::Wasm::trapHandler): (JSC::Wasm::registerCode): (JSC::Wasm::unregisterCode): (JSC::Wasm::fastMemoryEnabled): (JSC::Wasm::enableFastMemory): * wasm/WasmFaultSignalHandler.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp. * wasm/WasmFormat.h: (JSC::Wasm::ModuleInformation::importFunctionCount): (JSC::Wasm::ModuleInformation::hasMemory): Deleted. * wasm/WasmMemory.cpp: (JSC::Wasm::mmapBytes): (JSC::Wasm::Memory::lastAllocatedMode): (JSC::Wasm::availableFastMemories): (JSC::Wasm::tryGetFastMemory): (JSC::Wasm::releaseFastMemory): (JSC::Wasm::Memory::Memory): (JSC::Wasm::Memory::createImpl): (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::grow): (JSC::Wasm::Memory::dump): (JSC::Wasm::Memory::makeString): * wasm/WasmMemory.h: (JSC::Wasm::Memory::operator bool): (JSC::Wasm::Memory::size): (JSC::Wasm::Memory::check): (JSC::Wasm::Memory::Memory): Deleted. (JSC::Wasm::Memory::offsetOfMemory): Deleted. (JSC::Wasm::Memory::offsetOfSize): Deleted. * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::MemoryInformation::MemoryInformation): * wasm/WasmMemoryInformation.h: (JSC::Wasm::MemoryInformation::hasReservedMemory): (JSC::Wasm::MemoryInformation::takeReservedMemory): (JSC::Wasm::MemoryInformation::mode): * wasm/WasmModuleParser.cpp: * wasm/WasmModuleParser.h: (JSC::Wasm::ModuleParser::ModuleParser): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::parseAndValidateModule): (JSC::Wasm::Plan::run): * wasm/WasmPlan.h: (JSC::Wasm::Plan::mode): * wasm/js/JSWebAssemblyCallee.cpp: (JSC::JSWebAssemblyCallee::finishCreation): (JSC::JSWebAssemblyCallee::destroy): * wasm/js/JSWebAssemblyCodeBlock.cpp: Added. (JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock): (JSC::JSWebAssemblyCodeBlock::destroy): (JSC::JSWebAssemblyCodeBlock::isSafeToRun): (JSC::JSWebAssemblyCodeBlock::visitChildren): (JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::setMemory): (JSC::JSWebAssemblyInstance::finishCreation): (JSC::JSWebAssemblyInstance::visitChildren): * wasm/js/JSWebAssemblyInstance.h: (JSC::JSWebAssemblyInstance::module): (JSC::JSWebAssemblyInstance::codeBlock): (JSC::JSWebAssemblyInstance::memoryMode): (JSC::JSWebAssemblyInstance::setMemory): Deleted. * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::create): (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory): (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): (JSC::JSWebAssemblyMemory::destroy): * wasm/js/JSWebAssemblyMemory.h: (JSC::JSWebAssemblyMemory::memory): (JSC::JSWebAssemblyMemory::offsetOfMemory): (JSC::JSWebAssemblyMemory::offsetOfSize): * wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::buildCodeBlock): (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::JSWebAssemblyModule): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::finishCreation): (JSC::JSWebAssemblyModule::visitChildren): (JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally): Deleted. * wasm/js/JSWebAssemblyModule.h: (JSC::JSWebAssemblyModule::takeReservedMemory): (JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::functionImportCount): Deleted. (JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::setJSEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::setWasmEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::callees): Deleted. (JSC::JSWebAssemblyModule::offsetOfCallees): Deleted. (JSC::JSWebAssemblyModule::allocationSize): Deleted. * wasm/js/WebAssemblyFunction.cpp: (JSC::callWebAssemblyFunction): * wasm/js/WebAssemblyInstanceConstructor.cpp: (JSC::constructJSWebAssemblyInstance): * wasm/js/WebAssemblyMemoryConstructor.cpp: (JSC::constructJSWebAssemblyMemory): * wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): (JSC::WebAssemblyModuleRecord::evaluate): Source/WTF: Add new forms of dataLog that take a boolean which describes if the log should happen. This makes cases where we have a static const bool for printing nicer since you can do: dataLogIf(verbose, things, to, print); instead of: if (verbose) dataLog(things, to, print); Also, add a operator! to Ref that has the same semantics as C++ refs. * wtf/DataLog.h: (WTF::dataLogLn): (WTF::dataLogIf): (WTF::dataLogLnIf): * wtf/Ref.h: (WTF::Ref::operator!): Canonical link: https://commits.webkit.org/186166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-03 22:24:21 +00:00
dataLog(values...);
}
template<typename... Types>
ALWAYS_INLINE void dataLogLnIf(bool shouldLog, const Types&... values)
WASM should support faster loads. https://bugs.webkit.org/show_bug.cgi?id=162693 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds support for WebAssembly using a 32-bit address space for memory (along with some extra space for offset overflow). With a 32-bit address space (we call them Signaling/fast memories), we reserve the virtual address space for 2^32 + offset bytes of memory and only mark the usable section as read/write. If wasm code would read/write out of bounds we use a custom signal handler to catch the SIGBUS. The signal handler then checks if the faulting instruction is wasm code and tells the thread to resume executing from the wasm exception handler. Otherwise, the signal handler crashes the process, as usual. All of the allocations of these memories are managed by the Wasm::Memory class. In order to avoid TLB churn in the OS we cache old Signaling memories that are no longer in use. Since getting the wrong memory can cause recompiles, we try to reserve a memory for modules that do not import a memory. If a module does import a memory, we try to guess the type of memory we are going to get based on the last one allocated. This patch also changes how the wasm JS-api manages objects. Since we can compile different versions of code, this patch adds a new JSWebAssemblyCodeBlock class that holds all the information specific to running a module in a particular bounds checking mode. Additionally, the Wasm::Memory object is now a reference counted class that is shared between the JSWebAssemblyMemory object and the ArrayBuffer that also views it. * JavaScriptCore.xcodeproj/project.pbxproj: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): * jit/JITThunks.h: * jsc.cpp: (jscmain): * runtime/Options.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * wasm/JSWebAssemblyCodeBlock.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h. (JSC::JSWebAssemblyCodeBlock::create): (JSC::JSWebAssemblyCodeBlock::createStructure): (JSC::JSWebAssemblyCodeBlock::functionImportCount): (JSC::JSWebAssemblyCodeBlock::mode): (JSC::JSWebAssemblyCodeBlock::module): (JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::callees): (JSC::JSWebAssemblyCodeBlock::offsetOfCallees): (JSC::JSWebAssemblyCodeBlock::allocationSize): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): (JSC::Wasm::getMemoryBaseAndSize): (JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer): (JSC::Wasm::B3IRGenerator::emitLoadOp): (JSC::Wasm::B3IRGenerator::emitStoreOp): * wasm/WasmCallingConvention.h: * wasm/WasmFaultSignalHandler.cpp: Added. (JSC::Wasm::trapHandler): (JSC::Wasm::registerCode): (JSC::Wasm::unregisterCode): (JSC::Wasm::fastMemoryEnabled): (JSC::Wasm::enableFastMemory): * wasm/WasmFaultSignalHandler.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp. * wasm/WasmFormat.h: (JSC::Wasm::ModuleInformation::importFunctionCount): (JSC::Wasm::ModuleInformation::hasMemory): Deleted. * wasm/WasmMemory.cpp: (JSC::Wasm::mmapBytes): (JSC::Wasm::Memory::lastAllocatedMode): (JSC::Wasm::availableFastMemories): (JSC::Wasm::tryGetFastMemory): (JSC::Wasm::releaseFastMemory): (JSC::Wasm::Memory::Memory): (JSC::Wasm::Memory::createImpl): (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::grow): (JSC::Wasm::Memory::dump): (JSC::Wasm::Memory::makeString): * wasm/WasmMemory.h: (JSC::Wasm::Memory::operator bool): (JSC::Wasm::Memory::size): (JSC::Wasm::Memory::check): (JSC::Wasm::Memory::Memory): Deleted. (JSC::Wasm::Memory::offsetOfMemory): Deleted. (JSC::Wasm::Memory::offsetOfSize): Deleted. * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::MemoryInformation::MemoryInformation): * wasm/WasmMemoryInformation.h: (JSC::Wasm::MemoryInformation::hasReservedMemory): (JSC::Wasm::MemoryInformation::takeReservedMemory): (JSC::Wasm::MemoryInformation::mode): * wasm/WasmModuleParser.cpp: * wasm/WasmModuleParser.h: (JSC::Wasm::ModuleParser::ModuleParser): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::parseAndValidateModule): (JSC::Wasm::Plan::run): * wasm/WasmPlan.h: (JSC::Wasm::Plan::mode): * wasm/js/JSWebAssemblyCallee.cpp: (JSC::JSWebAssemblyCallee::finishCreation): (JSC::JSWebAssemblyCallee::destroy): * wasm/js/JSWebAssemblyCodeBlock.cpp: Added. (JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock): (JSC::JSWebAssemblyCodeBlock::destroy): (JSC::JSWebAssemblyCodeBlock::isSafeToRun): (JSC::JSWebAssemblyCodeBlock::visitChildren): (JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::setMemory): (JSC::JSWebAssemblyInstance::finishCreation): (JSC::JSWebAssemblyInstance::visitChildren): * wasm/js/JSWebAssemblyInstance.h: (JSC::JSWebAssemblyInstance::module): (JSC::JSWebAssemblyInstance::codeBlock): (JSC::JSWebAssemblyInstance::memoryMode): (JSC::JSWebAssemblyInstance::setMemory): Deleted. * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::create): (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory): (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): (JSC::JSWebAssemblyMemory::destroy): * wasm/js/JSWebAssemblyMemory.h: (JSC::JSWebAssemblyMemory::memory): (JSC::JSWebAssemblyMemory::offsetOfMemory): (JSC::JSWebAssemblyMemory::offsetOfSize): * wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::buildCodeBlock): (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::JSWebAssemblyModule): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::finishCreation): (JSC::JSWebAssemblyModule::visitChildren): (JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally): Deleted. * wasm/js/JSWebAssemblyModule.h: (JSC::JSWebAssemblyModule::takeReservedMemory): (JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::functionImportCount): Deleted. (JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::setJSEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::setWasmEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::callees): Deleted. (JSC::JSWebAssemblyModule::offsetOfCallees): Deleted. (JSC::JSWebAssemblyModule::allocationSize): Deleted. * wasm/js/WebAssemblyFunction.cpp: (JSC::callWebAssemblyFunction): * wasm/js/WebAssemblyInstanceConstructor.cpp: (JSC::constructJSWebAssemblyInstance): * wasm/js/WebAssemblyMemoryConstructor.cpp: (JSC::constructJSWebAssemblyMemory): * wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): (JSC::WebAssemblyModuleRecord::evaluate): Source/WTF: Add new forms of dataLog that take a boolean which describes if the log should happen. This makes cases where we have a static const bool for printing nicer since you can do: dataLogIf(verbose, things, to, print); instead of: if (verbose) dataLog(things, to, print); Also, add a operator! to Ref that has the same semantics as C++ refs. * wtf/DataLog.h: (WTF::dataLogLn): (WTF::dataLogIf): (WTF::dataLogLnIf): * wtf/Ref.h: (WTF::Ref::operator!): Canonical link: https://commits.webkit.org/186166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-03 22:24:21 +00:00
{
if (UNLIKELY(shouldLog))
WASM should support faster loads. https://bugs.webkit.org/show_bug.cgi?id=162693 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds support for WebAssembly using a 32-bit address space for memory (along with some extra space for offset overflow). With a 32-bit address space (we call them Signaling/fast memories), we reserve the virtual address space for 2^32 + offset bytes of memory and only mark the usable section as read/write. If wasm code would read/write out of bounds we use a custom signal handler to catch the SIGBUS. The signal handler then checks if the faulting instruction is wasm code and tells the thread to resume executing from the wasm exception handler. Otherwise, the signal handler crashes the process, as usual. All of the allocations of these memories are managed by the Wasm::Memory class. In order to avoid TLB churn in the OS we cache old Signaling memories that are no longer in use. Since getting the wrong memory can cause recompiles, we try to reserve a memory for modules that do not import a memory. If a module does import a memory, we try to guess the type of memory we are going to get based on the last one allocated. This patch also changes how the wasm JS-api manages objects. Since we can compile different versions of code, this patch adds a new JSWebAssemblyCodeBlock class that holds all the information specific to running a module in a particular bounds checking mode. Additionally, the Wasm::Memory object is now a reference counted class that is shared between the JSWebAssemblyMemory object and the ArrayBuffer that also views it. * JavaScriptCore.xcodeproj/project.pbxproj: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): * jit/JITThunks.h: * jsc.cpp: (jscmain): * runtime/Options.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * wasm/JSWebAssemblyCodeBlock.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h. (JSC::JSWebAssemblyCodeBlock::create): (JSC::JSWebAssemblyCodeBlock::createStructure): (JSC::JSWebAssemblyCodeBlock::functionImportCount): (JSC::JSWebAssemblyCodeBlock::mode): (JSC::JSWebAssemblyCodeBlock::module): (JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::callees): (JSC::JSWebAssemblyCodeBlock::offsetOfCallees): (JSC::JSWebAssemblyCodeBlock::allocationSize): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): (JSC::Wasm::getMemoryBaseAndSize): (JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer): (JSC::Wasm::B3IRGenerator::emitLoadOp): (JSC::Wasm::B3IRGenerator::emitStoreOp): * wasm/WasmCallingConvention.h: * wasm/WasmFaultSignalHandler.cpp: Added. (JSC::Wasm::trapHandler): (JSC::Wasm::registerCode): (JSC::Wasm::unregisterCode): (JSC::Wasm::fastMemoryEnabled): (JSC::Wasm::enableFastMemory): * wasm/WasmFaultSignalHandler.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp. * wasm/WasmFormat.h: (JSC::Wasm::ModuleInformation::importFunctionCount): (JSC::Wasm::ModuleInformation::hasMemory): Deleted. * wasm/WasmMemory.cpp: (JSC::Wasm::mmapBytes): (JSC::Wasm::Memory::lastAllocatedMode): (JSC::Wasm::availableFastMemories): (JSC::Wasm::tryGetFastMemory): (JSC::Wasm::releaseFastMemory): (JSC::Wasm::Memory::Memory): (JSC::Wasm::Memory::createImpl): (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::grow): (JSC::Wasm::Memory::dump): (JSC::Wasm::Memory::makeString): * wasm/WasmMemory.h: (JSC::Wasm::Memory::operator bool): (JSC::Wasm::Memory::size): (JSC::Wasm::Memory::check): (JSC::Wasm::Memory::Memory): Deleted. (JSC::Wasm::Memory::offsetOfMemory): Deleted. (JSC::Wasm::Memory::offsetOfSize): Deleted. * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::MemoryInformation::MemoryInformation): * wasm/WasmMemoryInformation.h: (JSC::Wasm::MemoryInformation::hasReservedMemory): (JSC::Wasm::MemoryInformation::takeReservedMemory): (JSC::Wasm::MemoryInformation::mode): * wasm/WasmModuleParser.cpp: * wasm/WasmModuleParser.h: (JSC::Wasm::ModuleParser::ModuleParser): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::parseAndValidateModule): (JSC::Wasm::Plan::run): * wasm/WasmPlan.h: (JSC::Wasm::Plan::mode): * wasm/js/JSWebAssemblyCallee.cpp: (JSC::JSWebAssemblyCallee::finishCreation): (JSC::JSWebAssemblyCallee::destroy): * wasm/js/JSWebAssemblyCodeBlock.cpp: Added. (JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock): (JSC::JSWebAssemblyCodeBlock::destroy): (JSC::JSWebAssemblyCodeBlock::isSafeToRun): (JSC::JSWebAssemblyCodeBlock::visitChildren): (JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::setMemory): (JSC::JSWebAssemblyInstance::finishCreation): (JSC::JSWebAssemblyInstance::visitChildren): * wasm/js/JSWebAssemblyInstance.h: (JSC::JSWebAssemblyInstance::module): (JSC::JSWebAssemblyInstance::codeBlock): (JSC::JSWebAssemblyInstance::memoryMode): (JSC::JSWebAssemblyInstance::setMemory): Deleted. * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::create): (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory): (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): (JSC::JSWebAssemblyMemory::destroy): * wasm/js/JSWebAssemblyMemory.h: (JSC::JSWebAssemblyMemory::memory): (JSC::JSWebAssemblyMemory::offsetOfMemory): (JSC::JSWebAssemblyMemory::offsetOfSize): * wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::buildCodeBlock): (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::JSWebAssemblyModule): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::finishCreation): (JSC::JSWebAssemblyModule::visitChildren): (JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally): Deleted. * wasm/js/JSWebAssemblyModule.h: (JSC::JSWebAssemblyModule::takeReservedMemory): (JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::functionImportCount): Deleted. (JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::setJSEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::setWasmEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::callees): Deleted. (JSC::JSWebAssemblyModule::offsetOfCallees): Deleted. (JSC::JSWebAssemblyModule::allocationSize): Deleted. * wasm/js/WebAssemblyFunction.cpp: (JSC::callWebAssemblyFunction): * wasm/js/WebAssemblyInstanceConstructor.cpp: (JSC::constructJSWebAssemblyInstance): * wasm/js/WebAssemblyMemoryConstructor.cpp: (JSC::constructJSWebAssemblyMemory): * wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): (JSC::WebAssemblyModuleRecord::evaluate): Source/WTF: Add new forms of dataLog that take a boolean which describes if the log should happen. This makes cases where we have a static const bool for printing nicer since you can do: dataLogIf(verbose, things, to, print); instead of: if (verbose) dataLog(things, to, print); Also, add a operator! to Ref that has the same semantics as C++ refs. * wtf/DataLog.h: (WTF::dataLogLn): (WTF::dataLogIf): (WTF::dataLogLnIf): * wtf/Ref.h: (WTF::Ref::operator!): Canonical link: https://commits.webkit.org/186166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-03 22:24:21 +00:00
dataLogLn(values...);
Implement WASM Parser and B3 IR generator https://bugs.webkit.org/show_bug.cgi?id=160681 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This patch adds the skeleton for a WebAssembly pipeline. The pipeline is designed in order to make it easy to have as much of the compilation process threaded as possible. The flow of the pipeline roughly goes as follows: 1) Create a WASMPlan with the VM and a Vector of the assembly. Currently the plan will process all the work synchronously, however, in the future this can be offloaded to other threads. 2) The plan will run the WASMModuleParser, which collates all the information needed to compile each module function independently. Since, we are still in the early phases, the only information is the starting and ending byte of the function's body. The module parser, however, still scans both and semi-validates the type and the function sections. 3) Each function is decoded and compiled. In the future this should also include a opcode validation phase. The WASMFunctionParser is templatized so that a validator should be able to use most of the same code the B3 IR generator does. 4) When the plan has finished it will fill a Vector of B3::Compilation objects that correspond to the respective function in the WASM module. The current testing plan for the modules is to inline the the binary generated by the spec's OCaml prototype. The inlined binary is passed to a WASMPlan then invoked to check the result of the function. In the future we should add a more robust testing infrastructure. * JavaScriptCore.xcodeproj/project.pbxproj: * testWASM.cpp: (printUsageStatement): (CommandLine::parseArguments): (invoke): (runWASMTests): (main): * wasm/JSWASMModule.h: (JSC::JSWASMModule::globalVariableTypes): * wasm/WASMB3IRGenerator.cpp: Added. (JSC::WASM::B3IRGenerator::B3IRGenerator): (JSC::WASM::B3IRGenerator::addLocal): (JSC::WASM::B3IRGenerator::binaryOp): (JSC::WASM::B3IRGenerator::addConstant): (JSC::WASM::B3IRGenerator::addBlock): (JSC::WASM::B3IRGenerator::endBlock): (JSC::WASM::B3IRGenerator::addReturn): (JSC::WASM::B3IRGenerator::unify): (JSC::WASM::B3IRGenerator::initializeIncommingTypes): (JSC::WASM::B3IRGenerator::unifyValuesWithLevel): (JSC::WASM::B3IRGenerator::stackForControlLevel): (JSC::WASM::B3IRGenerator::blockForControlLevel): (JSC::WASM::parseAndCompile): * wasm/WASMB3IRGenerator.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMFormat.h: * wasm/WASMFunctionParser.h: Added. (JSC::WASM::WASMFunctionParser<Context>::WASMFunctionParser): (JSC::WASM::WASMFunctionParser<Context>::parse): (JSC::WASM::WASMFunctionParser<Context>::parseBlock): (JSC::WASM::WASMFunctionParser<Context>::parseExpression): * wasm/WASMModuleParser.cpp: Added. (JSC::WASM::WASMModuleParser::parse): (JSC::WASM::WASMModuleParser::parseFunctionTypes): (JSC::WASM::WASMModuleParser::parseFunctionSignatures): (JSC::WASM::WASMModuleParser::parseFunctionDefinitions): * wasm/WASMModuleParser.h: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMModuleParser::WASMModuleParser): (JSC::WASM::WASMModuleParser::functionInformation): * wasm/WASMOps.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMParser.h: Added. (JSC::WASM::WASMParser::parseVarUInt32): (JSC::WASM::WASMParser::WASMParser): (JSC::WASM::WASMParser::consumeCharacter): (JSC::WASM::WASMParser::consumeString): (JSC::WASM::WASMParser::parseUInt32): (JSC::WASM::WASMParser::parseUInt7): (JSC::WASM::WASMParser::parseVarUInt1): (JSC::WASM::WASMParser::parseValueType): * wasm/WASMPlan.cpp: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::Plan::Plan): * wasm/WASMPlan.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMSections.cpp: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMSections::lookup): * wasm/WASMSections.h: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMSections::validateOrder): Source/WTF: * wtf/DataLog.h: (WTF::dataLogLn): Add a new dataLog function, dataLogLn that automagically includes a new line at the end of the print. * wtf/LEBDecoder.h: (decodeUInt32): (decodeInt32): Change the LEBDecoder to take a pointer and length rather than a Vector. Canonical link: https://commits.webkit.org/178982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-15 21:35:07 +00:00
}
It should be possible to send all JSC debug logging to a file https://bugs.webkit.org/show_bug.cgi?id=78418 Reviewed by Sam Weinig. Introduced wtf/DataLog, which defines WTF::dataFile, WTF::dataLog, and WTF::dataLogV. Changed all debugging- and profiling-related printfs to use WTF::dataLog() or one of its friends. By default, debug logging goes to stderr, unless you change the setting in wtf/DataLog.cpp. Source/JavaScriptCore: * GNUmakefile.list.am: * JavaScriptCore.gypi: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.h: (JSC::LinkBuffer::dumpLinkStatistics): (JSC::LinkBuffer::dumpCode): * assembler/SH4Assembler.h: (JSC::SH4Assembler::vprintfStdoutInstr): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::printGlobalResolveInfo): (JSC::printStructureStubInfo): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dump): (JSC::CodeBlock::dumpStatistics): (JSC::CodeBlock::finalizeUnconditionally): (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::endBasicBlock): (JSC::DFG::AbstractState::mergeStateAtTail): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): (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::parseCodeBlock): (JSC::DFG::ByteCodeParser::parse): * dfg/DFGCommon.h: * dfg/DFGDriver.cpp: (JSC::DFG::compile): * dfg/DFGGraph.cpp: (JSC::DFG::printWhiteSpace): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): (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/DFGPropagator.cpp: (JSC::DFG::Propagator::fixpoint): (JSC::DFG::Propagator::propagateArithNodeFlags): (JSC::DFG::Propagator::propagateArithNodeFlagsForward): (JSC::DFG::Propagator::propagateArithNodeFlagsBackward): (JSC::DFG::Propagator::propagateNodePredictions): (JSC::DFG::Propagator::propagatePredictionsForward): (JSC::DFG::Propagator::propagatePredictionsBackward): (JSC::DFG::Propagator::doRoundOfDoubleVoting): (JSC::DFG::Propagator::fixupNode): (JSC::DFG::Propagator::fixup): (JSC::DFG::Propagator::startIndexForChildren): (JSC::DFG::Propagator::endIndexForPureCSE): (JSC::DFG::Propagator::setReplacement): (JSC::DFG::Propagator::eliminate): (JSC::DFG::Propagator::performNodeCSE): (JSC::DFG::Propagator::localCSE): (JSC::DFG::Propagator::allocateVirtualRegisters): (JSC::DFG::Propagator::performBlockCFA): (JSC::DFG::Propagator::performForwardCFA): * dfg/DFGRegisterBank.h: (JSC::DFG::RegisterBank::dump): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::dump): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::dump): (JSC::DFG::SpeculativeJIT::checkConsistency): (JSC::DFG::SpeculativeJIT::compile): * 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): * heap/Heap.cpp: (JSC::Heap::destroy): * heap/MarkedBlock.h: * 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/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * 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/SamplingCounter.h: (JSC::DeletableSamplingCounter::~DeletableSamplingCounter): * runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print): * runtime/Structure.cpp: (JSC::Structure::dumpStatistics): (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger): * tools/CodeProfile.cpp: (JSC::CodeProfile::report): * tools/ProfileTreeNode.h: (JSC::ProfileTreeNode::dumpInternal): * wtf/CMakeLists.txt: * wtf/DataLog.cpp: Added. (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLog): * wtf/DataLog.h: Added. (WTF): * wtf/HashTable.cpp: (WTF::HashTableStats::~HashTableStats): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::dumpProfile): * wtf/text/WTFString.cpp: (String::show): * yarr/YarrInterpreter.cpp: (JSC::Yarr::ByteCompiler::dumpDisjunction): Source/WebCore: No new tests because behavior is unchanged. * ForwardingHeaders/wtf/DataLog.h: Added. Source/WTF: * WTF.pro: Canonical link: https://commits.webkit.org/95361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-12 03:21:32 +00:00
} // namespace WTF
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
using WTF::dataLog;
Implement WASM Parser and B3 IR generator https://bugs.webkit.org/show_bug.cgi?id=160681 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This patch adds the skeleton for a WebAssembly pipeline. The pipeline is designed in order to make it easy to have as much of the compilation process threaded as possible. The flow of the pipeline roughly goes as follows: 1) Create a WASMPlan with the VM and a Vector of the assembly. Currently the plan will process all the work synchronously, however, in the future this can be offloaded to other threads. 2) The plan will run the WASMModuleParser, which collates all the information needed to compile each module function independently. Since, we are still in the early phases, the only information is the starting and ending byte of the function's body. The module parser, however, still scans both and semi-validates the type and the function sections. 3) Each function is decoded and compiled. In the future this should also include a opcode validation phase. The WASMFunctionParser is templatized so that a validator should be able to use most of the same code the B3 IR generator does. 4) When the plan has finished it will fill a Vector of B3::Compilation objects that correspond to the respective function in the WASM module. The current testing plan for the modules is to inline the the binary generated by the spec's OCaml prototype. The inlined binary is passed to a WASMPlan then invoked to check the result of the function. In the future we should add a more robust testing infrastructure. * JavaScriptCore.xcodeproj/project.pbxproj: * testWASM.cpp: (printUsageStatement): (CommandLine::parseArguments): (invoke): (runWASMTests): (main): * wasm/JSWASMModule.h: (JSC::JSWASMModule::globalVariableTypes): * wasm/WASMB3IRGenerator.cpp: Added. (JSC::WASM::B3IRGenerator::B3IRGenerator): (JSC::WASM::B3IRGenerator::addLocal): (JSC::WASM::B3IRGenerator::binaryOp): (JSC::WASM::B3IRGenerator::addConstant): (JSC::WASM::B3IRGenerator::addBlock): (JSC::WASM::B3IRGenerator::endBlock): (JSC::WASM::B3IRGenerator::addReturn): (JSC::WASM::B3IRGenerator::unify): (JSC::WASM::B3IRGenerator::initializeIncommingTypes): (JSC::WASM::B3IRGenerator::unifyValuesWithLevel): (JSC::WASM::B3IRGenerator::stackForControlLevel): (JSC::WASM::B3IRGenerator::blockForControlLevel): (JSC::WASM::parseAndCompile): * wasm/WASMB3IRGenerator.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMFormat.h: * wasm/WASMFunctionParser.h: Added. (JSC::WASM::WASMFunctionParser<Context>::WASMFunctionParser): (JSC::WASM::WASMFunctionParser<Context>::parse): (JSC::WASM::WASMFunctionParser<Context>::parseBlock): (JSC::WASM::WASMFunctionParser<Context>::parseExpression): * wasm/WASMModuleParser.cpp: Added. (JSC::WASM::WASMModuleParser::parse): (JSC::WASM::WASMModuleParser::parseFunctionTypes): (JSC::WASM::WASMModuleParser::parseFunctionSignatures): (JSC::WASM::WASMModuleParser::parseFunctionDefinitions): * wasm/WASMModuleParser.h: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMModuleParser::WASMModuleParser): (JSC::WASM::WASMModuleParser::functionInformation): * wasm/WASMOps.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMParser.h: Added. (JSC::WASM::WASMParser::parseVarUInt32): (JSC::WASM::WASMParser::WASMParser): (JSC::WASM::WASMParser::consumeCharacter): (JSC::WASM::WASMParser::consumeString): (JSC::WASM::WASMParser::parseUInt32): (JSC::WASM::WASMParser::parseUInt7): (JSC::WASM::WASMParser::parseVarUInt1): (JSC::WASM::WASMParser::parseValueType): * wasm/WASMPlan.cpp: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::Plan::Plan): * wasm/WASMPlan.h: Copied from Source/WTF/wtf/DataLog.h. * wasm/WASMSections.cpp: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMSections::lookup): * wasm/WASMSections.h: Copied from Source/WTF/wtf/DataLog.h. (JSC::WASM::WASMSections::validateOrder): Source/WTF: * wtf/DataLog.h: (WTF::dataLogLn): Add a new dataLog function, dataLogLn that automagically includes a new line at the end of the print. * wtf/LEBDecoder.h: (decodeUInt32): (decodeInt32): Change the LEBDecoder to take a pointer and length rather than a Vector. Canonical link: https://commits.webkit.org/178982@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-15 21:35:07 +00:00
using WTF::dataLogLn;
WASM should support faster loads. https://bugs.webkit.org/show_bug.cgi?id=162693 Reviewed by Saam Barati. Source/JavaScriptCore: This patch adds support for WebAssembly using a 32-bit address space for memory (along with some extra space for offset overflow). With a 32-bit address space (we call them Signaling/fast memories), we reserve the virtual address space for 2^32 + offset bytes of memory and only mark the usable section as read/write. If wasm code would read/write out of bounds we use a custom signal handler to catch the SIGBUS. The signal handler then checks if the faulting instruction is wasm code and tells the thread to resume executing from the wasm exception handler. Otherwise, the signal handler crashes the process, as usual. All of the allocations of these memories are managed by the Wasm::Memory class. In order to avoid TLB churn in the OS we cache old Signaling memories that are no longer in use. Since getting the wrong memory can cause recompiles, we try to reserve a memory for modules that do not import a memory. If a module does import a memory, we try to guess the type of memory we are going to get based on the last one allocated. This patch also changes how the wasm JS-api manages objects. Since we can compile different versions of code, this patch adds a new JSWebAssemblyCodeBlock class that holds all the information specific to running a module in a particular bounds checking mode. Additionally, the Wasm::Memory object is now a reference counted class that is shared between the JSWebAssemblyMemory object and the ArrayBuffer that also views it. * JavaScriptCore.xcodeproj/project.pbxproj: * jit/JITThunks.cpp: (JSC::JITThunks::existingCTIStub): * jit/JITThunks.h: * jsc.cpp: (jscmain): * runtime/Options.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * wasm/JSWebAssemblyCodeBlock.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyModule.h. (JSC::JSWebAssemblyCodeBlock::create): (JSC::JSWebAssemblyCodeBlock::createStructure): (JSC::JSWebAssemblyCodeBlock::functionImportCount): (JSC::JSWebAssemblyCodeBlock::mode): (JSC::JSWebAssemblyCodeBlock::module): (JSC::JSWebAssemblyCodeBlock::jsEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace): (JSC::JSWebAssemblyCodeBlock::setJSEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::setWasmEntrypointCallee): (JSC::JSWebAssemblyCodeBlock::callees): (JSC::JSWebAssemblyCodeBlock::offsetOfCallees): (JSC::JSWebAssemblyCodeBlock::allocationSize): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::B3IRGenerator): (JSC::Wasm::getMemoryBaseAndSize): (JSC::Wasm::B3IRGenerator::emitCheckAndPreparePointer): (JSC::Wasm::B3IRGenerator::emitLoadOp): (JSC::Wasm::B3IRGenerator::emitStoreOp): * wasm/WasmCallingConvention.h: * wasm/WasmFaultSignalHandler.cpp: Added. (JSC::Wasm::trapHandler): (JSC::Wasm::registerCode): (JSC::Wasm::unregisterCode): (JSC::Wasm::fastMemoryEnabled): (JSC::Wasm::enableFastMemory): * wasm/WasmFaultSignalHandler.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyCallee.cpp. * wasm/WasmFormat.h: (JSC::Wasm::ModuleInformation::importFunctionCount): (JSC::Wasm::ModuleInformation::hasMemory): Deleted. * wasm/WasmMemory.cpp: (JSC::Wasm::mmapBytes): (JSC::Wasm::Memory::lastAllocatedMode): (JSC::Wasm::availableFastMemories): (JSC::Wasm::tryGetFastMemory): (JSC::Wasm::releaseFastMemory): (JSC::Wasm::Memory::Memory): (JSC::Wasm::Memory::createImpl): (JSC::Wasm::Memory::create): (JSC::Wasm::Memory::~Memory): (JSC::Wasm::Memory::grow): (JSC::Wasm::Memory::dump): (JSC::Wasm::Memory::makeString): * wasm/WasmMemory.h: (JSC::Wasm::Memory::operator bool): (JSC::Wasm::Memory::size): (JSC::Wasm::Memory::check): (JSC::Wasm::Memory::Memory): Deleted. (JSC::Wasm::Memory::offsetOfMemory): Deleted. (JSC::Wasm::Memory::offsetOfSize): Deleted. * wasm/WasmMemoryInformation.cpp: (JSC::Wasm::MemoryInformation::MemoryInformation): * wasm/WasmMemoryInformation.h: (JSC::Wasm::MemoryInformation::hasReservedMemory): (JSC::Wasm::MemoryInformation::takeReservedMemory): (JSC::Wasm::MemoryInformation::mode): * wasm/WasmModuleParser.cpp: * wasm/WasmModuleParser.h: (JSC::Wasm::ModuleParser::ModuleParser): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::parseAndValidateModule): (JSC::Wasm::Plan::run): * wasm/WasmPlan.h: (JSC::Wasm::Plan::mode): * wasm/js/JSWebAssemblyCallee.cpp: (JSC::JSWebAssemblyCallee::finishCreation): (JSC::JSWebAssemblyCallee::destroy): * wasm/js/JSWebAssemblyCodeBlock.cpp: Added. (JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock): (JSC::JSWebAssemblyCodeBlock::destroy): (JSC::JSWebAssemblyCodeBlock::isSafeToRun): (JSC::JSWebAssemblyCodeBlock::visitChildren): (JSC::JSWebAssemblyCodeBlock::UnconditionalFinalizer::finalizeUnconditionally): * wasm/js/JSWebAssemblyInstance.cpp: (JSC::JSWebAssemblyInstance::setMemory): (JSC::JSWebAssemblyInstance::finishCreation): (JSC::JSWebAssemblyInstance::visitChildren): * wasm/js/JSWebAssemblyInstance.h: (JSC::JSWebAssemblyInstance::module): (JSC::JSWebAssemblyInstance::codeBlock): (JSC::JSWebAssemblyInstance::memoryMode): (JSC::JSWebAssemblyInstance::setMemory): Deleted. * wasm/js/JSWebAssemblyMemory.cpp: (JSC::JSWebAssemblyMemory::create): (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory): (JSC::JSWebAssemblyMemory::buffer): (JSC::JSWebAssemblyMemory::grow): (JSC::JSWebAssemblyMemory::destroy): * wasm/js/JSWebAssemblyMemory.h: (JSC::JSWebAssemblyMemory::memory): (JSC::JSWebAssemblyMemory::offsetOfMemory): (JSC::JSWebAssemblyMemory::offsetOfSize): * wasm/js/JSWebAssemblyModule.cpp: (JSC::JSWebAssemblyModule::buildCodeBlock): (JSC::JSWebAssemblyModule::create): (JSC::JSWebAssemblyModule::JSWebAssemblyModule): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::finishCreation): (JSC::JSWebAssemblyModule::visitChildren): (JSC::JSWebAssemblyModule::UnconditionalFinalizer::finalizeUnconditionally): Deleted. * wasm/js/JSWebAssemblyModule.h: (JSC::JSWebAssemblyModule::takeReservedMemory): (JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace): (JSC::JSWebAssemblyModule::codeBlock): (JSC::JSWebAssemblyModule::functionImportCount): Deleted. (JSC::JSWebAssemblyModule::jsEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::wasmEntrypointCalleeFromFunctionIndexSpace): Deleted. (JSC::JSWebAssemblyModule::setJSEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::setWasmEntrypointCallee): Deleted. (JSC::JSWebAssemblyModule::callees): Deleted. (JSC::JSWebAssemblyModule::offsetOfCallees): Deleted. (JSC::JSWebAssemblyModule::allocationSize): Deleted. * wasm/js/WebAssemblyFunction.cpp: (JSC::callWebAssemblyFunction): * wasm/js/WebAssemblyInstanceConstructor.cpp: (JSC::constructJSWebAssemblyInstance): * wasm/js/WebAssemblyMemoryConstructor.cpp: (JSC::constructJSWebAssemblyMemory): * wasm/js/WebAssemblyModuleConstructor.cpp: (JSC::WebAssemblyModuleConstructor::createModule): * wasm/js/WebAssemblyModuleRecord.cpp: (JSC::WebAssemblyModuleRecord::link): (JSC::WebAssemblyModuleRecord::evaluate): Source/WTF: Add new forms of dataLog that take a boolean which describes if the log should happen. This makes cases where we have a static const bool for printing nicer since you can do: dataLogIf(verbose, things, to, print); instead of: if (verbose) dataLog(things, to, print); Also, add a operator! to Ref that has the same semantics as C++ refs. * wtf/DataLog.h: (WTF::dataLogLn): (WTF::dataLogIf): (WTF::dataLogLnIf): * wtf/Ref.h: (WTF::Ref::operator!): Canonical link: https://commits.webkit.org/186166@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-03 22:24:21 +00:00
using WTF::dataLogIf;
using WTF::dataLogLnIf;
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
using WTF::dataLogF;
using WTF::dataLogFString;