haikuwebkit/Source/WTF/wtf/StringPrintStream.h

81 lines
2.6 KiB
C
Raw Permalink Normal View History

SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
/*
FTL B3 should be just as fast as FTL LLVM on Octane/crypto https://bugs.webkit.org/show_bug.cgi?id=153113 Reviewed by Saam Barati. Source/JavaScriptCore: This is the result of a hacking rampage to close the gap between FTL B3 and FTL LLVM on Octane/crypto. It was a very successful rampage. The biggest change in this patch is the introduction of a phase called fixObviousSpills() that fixes patterns like: Store register to stack slot and then use stack slot: Move %rcx, (stack42) Foo use:(stack42) // replace (stack42) with %rcx here. Load stack slot into register and then use stack slot: Move (stack42), %rcx Foo use:(stack42) // replace (stack42) with %rcx here. Store constant into stack slot and then use stack slot: Move $42, %rcx Move %rcx, (stack42) Bar def:%rcx // %rcx isn't available anymore, but we still know that (stack42) is $42 Foo use:(stack42) // replace (stack42) with $42 here. This phases does these fixups by doing a global forward flow that propagates sets of must-aliases. Also added a phase to report register pressure. It pretty-prints code alongside the set of in-use registers above each instruction. Using this phase, I found that our register allocator is actually doing a pretty awesome job. I had previously feared that we'd have to make substantial changes to register allocation. I don't have such a fear anymore, at least for Octane/crypto. In the future, we can check how the regalloc is performing just by enabling logAirRegisterPressure. Also fixed some FTL codegen pathologies. We were using bitOr where we meant to use a conditional or. LLVM likes to canonicalize boolean expressions this way. B3, on the other hand, doesn't do this canonicalization and doesn't have logic to decompose it into sequences of branches. Also added strength reductions for checked arithmetic. It turns out that LLVM learned how to reduce checked multiply to unchecked multiply in some obvious cases that our existing DFG optimizations lacked. Ideally, our DFG integer range optimization phase would cover this. But the cases of interest were dead simple - the incoming values to the CheckMul were obviously too small to cause overflow. I added such reasoning to B3's strength reduction. Finally, this fixes some bugs with how we were handling subwidth spill slots. The register allocator was making two mistakes. First, it might cause a Width64 def or use of a 4-byte spill slot. In that case, it would extend the size of the spill slot to ensure that the use or def is safe. Second, it emulates ZDef on Tmp behavior by emitting a Move32 to initialize the high bits of a spill slot. But this is unsound because of the liveness semantics of spill slots. They cannot have more than one def to initialize their value. I fixed that by making allocateStack() be the thing that fixes ZDefs. That's a change to ZDef semantics: now, ZDef on an anonymous stack slot means that the high bits are zero-filled. I wasn't able to construct a test for this. It might be a hypothetical bug, but still, I like how this simplifies the register allocator. This is a ~0.7% speed-up on Octane. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3CheckSpecial.cpp: (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::commitHiddenBranch): Deleted. * b3/B3CheckSpecial.h: * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::fillStackmap): (JSC::B3::Air::LowerToAir::lower): * b3/B3StackmapValue.h: * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: * b3/air/AirArg.h: (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::stackAddr): (JSC::B3::Air::Arg::isValidScale): * b3/air/AirBasicBlock.cpp: (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::dumpHeader): (JSC::B3::Air::BasicBlock::dumpFooter): * b3/air/AirBasicBlock.h: * b3/air/AirCCallSpecial.cpp: (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): * b3/air/AirCode.h: (JSC::B3::Air::Code::lastPhaseName): (JSC::B3::Air::Code::setEnableRCRS): (JSC::B3::Air::Code::enableRCRS): * b3/air/AirCustom.cpp: (JSC::B3::Air::PatchCustom::isValidForm): (JSC::B3::Air::CCallCustom::isValidForm): * b3/air/AirCustom.h: (JSC::B3::Air::PatchCustom::isValidFormStatic): (JSC::B3::Air::PatchCustom::admitsStack): (JSC::B3::Air::PatchCustom::isValidForm): Deleted. * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::ShufflePair::dump): (JSC::B3::Air::createShuffle): (JSC::B3::Air::emitShuffle): * b3/air/AirEmitShuffle.h: * b3/air/AirFixObviousSpills.cpp: Added. (JSC::B3::Air::fixObviousSpills): * b3/air/AirFixObviousSpills.h: Added. * b3/air/AirFixSpillSlotZDef.h: Removed. * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirInst.h: * b3/air/AirInstInlines.h: (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::Inst::admitsStack): (JSC::B3::Air::isShiftValid): * b3/air/AirIteratedRegisterCoalescing.cpp: * b3/air/AirLiveness.h: (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::begin): (JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::end): (JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::contains): (JSC::B3::Air::AbstractLiveness::LocalCalc::live): (JSC::B3::Air::AbstractLiveness::LocalCalc::isLive): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): (JSC::B3::Air::AbstractLiveness::rawLiveAtHead): (JSC::B3::Air::AbstractLiveness::Iterable::begin): (JSC::B3::Air::AbstractLiveness::Iterable::end): (JSC::B3::Air::AbstractLiveness::Iterable::contains): (JSC::B3::Air::AbstractLiveness::liveAtTail): (JSC::B3::Air::AbstractLiveness::workset): * b3/air/AirLogRegisterPressure.cpp: Added. (JSC::B3::Air::logRegisterPressure): * b3/air/AirLogRegisterPressure.h: Added. * b3/air/AirOptimizeBlockOrder.cpp: (JSC::B3::Air::blocksInOptimizedOrder): (JSC::B3::Air::optimizeBlockOrder): * b3/air/AirOptimizeBlockOrder.h: * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * b3/air/AirReportUsedRegisters.h: * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirStackSlot.h: (JSC::B3::Air::StackSlot::isLocked): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::ensureSize): (JSC::B3::Air::StackSlot::alignment): * b3/air/AirValidate.cpp: * ftl/FTLB3Compile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileArithMul): (JSC::FTL::DFG::LowerDFGToLLVM::compileArithDiv): (JSC::FTL::DFG::LowerDFGToLLVM::compileArithMod): * jit/RegisterSet.h: (JSC::RegisterSet::get): (JSC::RegisterSet::setAll): (JSC::RegisterSet::merge): (JSC::RegisterSet::filter): * runtime/Options.h: Source/WTF: * wtf/IndexSparseSet.h: (WTF::IndexSparseSet<OverflowHandler>::IndexSparseSet): (WTF::IndexSparseSet<OverflowHandler>::add): (WTF::IndexSparseSet<OverflowHandler>::remove): * wtf/StringPrintStream.h: (WTF::StringPrintStream::length): Canonical link: https://commits.webkit.org/171308@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-19 19:20:35 +00:00
* Copyright (C) 2012, 2016 Apple Inc. All rights reserved.
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
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
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
#include <wtf/PrintStream.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
namespace WTF {
Fix existing usage of final/override/virtual in JSC and WTF https://bugs.webkit.org/show_bug.cgi?id=211772 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSAPIWrapperObject.mm: * API/JSManagedValue.mm: * API/JSScriptSourceProvider.h: * API/ObjCCallbackFunction.mm: * API/glib/JSAPIWrapperGlobalObject.cpp: * API/glib/JSAPIWrapperObjectGLib.cpp: * API/glib/JSCWeakValue.cpp: * bytecode/AccessCaseSnippetParams.cpp: * bytecode/AccessCaseSnippetParams.h: * bytecode/CodeBlock.cpp: * bytecode/StructureStubClearingWatchpoint.h: * bytecode/VariableWriteFireDetail.h: * bytecode/Watchpoint.h: * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h: * dfg/DFGArrayifySlowPathGenerator.h: * dfg/DFGCallArrayAllocatorSlowPathGenerator.h: * dfg/DFGCallCreateDirectArgumentsSlowPathGenerator.h: * dfg/DFGSaneStringGetByValSlowPathGenerator.h: * dfg/DFGSlowPathGenerator.h: * dfg/DFGSnippetParams.h: * dfg/DFGWorklist.cpp: * ftl/FTLSnippetParams.h: * heap/BlockDirectory.cpp: * heap/EdenGCActivityCallback.h: * heap/FullGCActivityCallback.h: * heap/Heap.cpp: * heap/Heap.h: * heap/IncrementalSweeper.h: * heap/IsoCellSet.cpp: * heap/IsoCellSetInlines.h: * heap/IsoHeapCellType.h: * heap/IsoInlinedHeapCellType.h: * heap/ParallelSourceAdapter.h: * heap/StopIfNecessaryTimer.h: * heap/Subspace.cpp: * heap/SubspaceInlines.h: * inspector/InjectedScript.h: * inspector/JSGlobalObjectConsoleClient.h: * inspector/JSGlobalObjectInspectorController.h: * inspector/JSGlobalObjectScriptDebugServer.h: * inspector/JSInjectedScriptHost.cpp: * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorScriptProfilerAgent.h: * inspector/agents/InspectorTargetAgent.h: * inspector/agents/JSGlobalObjectAuditAgent.h: * inspector/agents/JSGlobalObjectDebuggerAgent.h: * inspector/agents/JSGlobalObjectRuntimeAgent.h: * inspector/augmentable/AlternateDispatchableAgent.h: * inspector/remote/RemoteConnectionToTarget.h: * inspector/remote/RemoteInspector.h: * inspector/remote/socket/RemoteInspectorServer.h: * inspector/scripts/codegen/cpp_generator_templates.py: * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: * inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result: * inspector/scripts/tests/generic/expected/enum-values.json-result: * inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result: * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result: * jit/JITWorklist.cpp: * parser/Nodes.h: * parser/SourceProvider.h: * runtime/DataView.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/FileBasedFuzzerAgent.h: * runtime/GenericTypedArrayView.h: * runtime/JSMicrotask.cpp: * runtime/NarrowingNumberPredictionFuzzerAgent.h: * runtime/ObjectPropertyChangeAdaptiveWatchpoint.h: * runtime/PredictionFileCreatingFuzzerAgent.h: * runtime/PromiseTimer.h: * runtime/RandomizingFuzzerAgent.h: * runtime/RegExpCache.h: * runtime/Structure.cpp: * runtime/StructureRareData.cpp: * runtime/VMTraps.cpp: * runtime/WideningNumberPredictionFuzzerAgent.h: * tools/JSDollarVM.cpp: * wasm/WasmBBQPlan.h: * wasm/WasmCallee.h: * wasm/WasmLLIntPlan.h: * wasm/WasmOMGForOSREntryPlan.h: * wasm/WasmOMGPlan.h: * wasm/WasmWorklist.cpp: * yarr/YarrJIT.cpp: Source/WTF: * wtf/Assertions.cpp: * wtf/Expected.h: * wtf/FilePrintStream.h: * wtf/JSONValues.h: * wtf/LockedPrintStream.h: * wtf/OSLogPrintStream.h: * wtf/ParallelHelperPool.cpp: * wtf/RunLoop.h: * wtf/SharedTask.h: * wtf/StringPrintStream.h: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: Canonical link: https://commits.webkit.org/224683@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-12 19:13:18 +00:00
class StringPrintStream final : public PrintStream {
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
public:
WTF_EXPORT_PRIVATE StringPrintStream();
Fix existing usage of final/override/virtual in JSC and WTF https://bugs.webkit.org/show_bug.cgi?id=211772 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSAPIWrapperObject.mm: * API/JSManagedValue.mm: * API/JSScriptSourceProvider.h: * API/ObjCCallbackFunction.mm: * API/glib/JSAPIWrapperGlobalObject.cpp: * API/glib/JSAPIWrapperObjectGLib.cpp: * API/glib/JSCWeakValue.cpp: * bytecode/AccessCaseSnippetParams.cpp: * bytecode/AccessCaseSnippetParams.h: * bytecode/CodeBlock.cpp: * bytecode/StructureStubClearingWatchpoint.h: * bytecode/VariableWriteFireDetail.h: * bytecode/Watchpoint.h: * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h: * dfg/DFGArrayifySlowPathGenerator.h: * dfg/DFGCallArrayAllocatorSlowPathGenerator.h: * dfg/DFGCallCreateDirectArgumentsSlowPathGenerator.h: * dfg/DFGSaneStringGetByValSlowPathGenerator.h: * dfg/DFGSlowPathGenerator.h: * dfg/DFGSnippetParams.h: * dfg/DFGWorklist.cpp: * ftl/FTLSnippetParams.h: * heap/BlockDirectory.cpp: * heap/EdenGCActivityCallback.h: * heap/FullGCActivityCallback.h: * heap/Heap.cpp: * heap/Heap.h: * heap/IncrementalSweeper.h: * heap/IsoCellSet.cpp: * heap/IsoCellSetInlines.h: * heap/IsoHeapCellType.h: * heap/IsoInlinedHeapCellType.h: * heap/ParallelSourceAdapter.h: * heap/StopIfNecessaryTimer.h: * heap/Subspace.cpp: * heap/SubspaceInlines.h: * inspector/InjectedScript.h: * inspector/JSGlobalObjectConsoleClient.h: * inspector/JSGlobalObjectInspectorController.h: * inspector/JSGlobalObjectScriptDebugServer.h: * inspector/JSInjectedScriptHost.cpp: * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorScriptProfilerAgent.h: * inspector/agents/InspectorTargetAgent.h: * inspector/agents/JSGlobalObjectAuditAgent.h: * inspector/agents/JSGlobalObjectDebuggerAgent.h: * inspector/agents/JSGlobalObjectRuntimeAgent.h: * inspector/augmentable/AlternateDispatchableAgent.h: * inspector/remote/RemoteConnectionToTarget.h: * inspector/remote/RemoteInspector.h: * inspector/remote/socket/RemoteInspectorServer.h: * inspector/scripts/codegen/cpp_generator_templates.py: * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: * inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result: * inspector/scripts/tests/generic/expected/enum-values.json-result: * inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result: * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result: * jit/JITWorklist.cpp: * parser/Nodes.h: * parser/SourceProvider.h: * runtime/DataView.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/FileBasedFuzzerAgent.h: * runtime/GenericTypedArrayView.h: * runtime/JSMicrotask.cpp: * runtime/NarrowingNumberPredictionFuzzerAgent.h: * runtime/ObjectPropertyChangeAdaptiveWatchpoint.h: * runtime/PredictionFileCreatingFuzzerAgent.h: * runtime/PromiseTimer.h: * runtime/RandomizingFuzzerAgent.h: * runtime/RegExpCache.h: * runtime/Structure.cpp: * runtime/StructureRareData.cpp: * runtime/VMTraps.cpp: * runtime/WideningNumberPredictionFuzzerAgent.h: * tools/JSDollarVM.cpp: * wasm/WasmBBQPlan.h: * wasm/WasmCallee.h: * wasm/WasmLLIntPlan.h: * wasm/WasmOMGForOSREntryPlan.h: * wasm/WasmOMGPlan.h: * wasm/WasmWorklist.cpp: * yarr/YarrJIT.cpp: Source/WTF: * wtf/Assertions.cpp: * wtf/Expected.h: * wtf/FilePrintStream.h: * wtf/JSONValues.h: * wtf/LockedPrintStream.h: * wtf/OSLogPrintStream.h: * wtf/ParallelHelperPool.cpp: * wtf/RunLoop.h: * wtf/SharedTask.h: * wtf/StringPrintStream.h: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: Canonical link: https://commits.webkit.org/224683@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-12 19:13:18 +00:00
WTF_EXPORT_PRIVATE ~StringPrintStream() final;
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
Fix existing usage of final/override/virtual in JSC and WTF https://bugs.webkit.org/show_bug.cgi?id=211772 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSAPIWrapperObject.mm: * API/JSManagedValue.mm: * API/JSScriptSourceProvider.h: * API/ObjCCallbackFunction.mm: * API/glib/JSAPIWrapperGlobalObject.cpp: * API/glib/JSAPIWrapperObjectGLib.cpp: * API/glib/JSCWeakValue.cpp: * bytecode/AccessCaseSnippetParams.cpp: * bytecode/AccessCaseSnippetParams.h: * bytecode/CodeBlock.cpp: * bytecode/StructureStubClearingWatchpoint.h: * bytecode/VariableWriteFireDetail.h: * bytecode/Watchpoint.h: * dfg/DFGAdaptiveInferredPropertyValueWatchpoint.h: * dfg/DFGArrayifySlowPathGenerator.h: * dfg/DFGCallArrayAllocatorSlowPathGenerator.h: * dfg/DFGCallCreateDirectArgumentsSlowPathGenerator.h: * dfg/DFGSaneStringGetByValSlowPathGenerator.h: * dfg/DFGSlowPathGenerator.h: * dfg/DFGSnippetParams.h: * dfg/DFGWorklist.cpp: * ftl/FTLSnippetParams.h: * heap/BlockDirectory.cpp: * heap/EdenGCActivityCallback.h: * heap/FullGCActivityCallback.h: * heap/Heap.cpp: * heap/Heap.h: * heap/IncrementalSweeper.h: * heap/IsoCellSet.cpp: * heap/IsoCellSetInlines.h: * heap/IsoHeapCellType.h: * heap/IsoInlinedHeapCellType.h: * heap/ParallelSourceAdapter.h: * heap/StopIfNecessaryTimer.h: * heap/Subspace.cpp: * heap/SubspaceInlines.h: * inspector/InjectedScript.h: * inspector/JSGlobalObjectConsoleClient.h: * inspector/JSGlobalObjectInspectorController.h: * inspector/JSGlobalObjectScriptDebugServer.h: * inspector/JSInjectedScriptHost.cpp: * inspector/agents/InspectorAgent.h: * inspector/agents/InspectorScriptProfilerAgent.h: * inspector/agents/InspectorTargetAgent.h: * inspector/agents/JSGlobalObjectAuditAgent.h: * inspector/agents/JSGlobalObjectDebuggerAgent.h: * inspector/agents/JSGlobalObjectRuntimeAgent.h: * inspector/augmentable/AlternateDispatchableAgent.h: * inspector/remote/RemoteConnectionToTarget.h: * inspector/remote/RemoteInspector.h: * inspector/remote/socket/RemoteInspectorServer.h: * inspector/scripts/codegen/cpp_generator_templates.py: * inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py: * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: * inspector/scripts/tests/generic/expected/command-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/generic/expected/domain-debuggableTypes.json-result: * inspector/scripts/tests/generic/expected/domain-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/domain-targetTypes.json-result: * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result: * inspector/scripts/tests/generic/expected/enum-values.json-result: * inspector/scripts/tests/generic/expected/event-targetType-matching-domain-debuggableType.json-result: * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result: * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result: * jit/JITWorklist.cpp: * parser/Nodes.h: * parser/SourceProvider.h: * runtime/DataView.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/FileBasedFuzzerAgent.h: * runtime/GenericTypedArrayView.h: * runtime/JSMicrotask.cpp: * runtime/NarrowingNumberPredictionFuzzerAgent.h: * runtime/ObjectPropertyChangeAdaptiveWatchpoint.h: * runtime/PredictionFileCreatingFuzzerAgent.h: * runtime/PromiseTimer.h: * runtime/RandomizingFuzzerAgent.h: * runtime/RegExpCache.h: * runtime/Structure.cpp: * runtime/StructureRareData.cpp: * runtime/VMTraps.cpp: * runtime/WideningNumberPredictionFuzzerAgent.h: * tools/JSDollarVM.cpp: * wasm/WasmBBQPlan.h: * wasm/WasmCallee.h: * wasm/WasmLLIntPlan.h: * wasm/WasmOMGForOSREntryPlan.h: * wasm/WasmOMGPlan.h: * wasm/WasmWorklist.cpp: * yarr/YarrJIT.cpp: Source/WTF: * wtf/Assertions.cpp: * wtf/Expected.h: * wtf/FilePrintStream.h: * wtf/JSONValues.h: * wtf/LockedPrintStream.h: * wtf/OSLogPrintStream.h: * wtf/ParallelHelperPool.cpp: * wtf/RunLoop.h: * wtf/SharedTask.h: * wtf/StringPrintStream.h: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: Canonical link: https://commits.webkit.org/224683@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-12 19:13:18 +00:00
WTF_EXPORT_PRIVATE void vprintf(const char* format, va_list) final WTF_ATTRIBUTE_PRINTF(2, 0);
FTL B3 should be just as fast as FTL LLVM on Octane/crypto https://bugs.webkit.org/show_bug.cgi?id=153113 Reviewed by Saam Barati. Source/JavaScriptCore: This is the result of a hacking rampage to close the gap between FTL B3 and FTL LLVM on Octane/crypto. It was a very successful rampage. The biggest change in this patch is the introduction of a phase called fixObviousSpills() that fixes patterns like: Store register to stack slot and then use stack slot: Move %rcx, (stack42) Foo use:(stack42) // replace (stack42) with %rcx here. Load stack slot into register and then use stack slot: Move (stack42), %rcx Foo use:(stack42) // replace (stack42) with %rcx here. Store constant into stack slot and then use stack slot: Move $42, %rcx Move %rcx, (stack42) Bar def:%rcx // %rcx isn't available anymore, but we still know that (stack42) is $42 Foo use:(stack42) // replace (stack42) with $42 here. This phases does these fixups by doing a global forward flow that propagates sets of must-aliases. Also added a phase to report register pressure. It pretty-prints code alongside the set of in-use registers above each instruction. Using this phase, I found that our register allocator is actually doing a pretty awesome job. I had previously feared that we'd have to make substantial changes to register allocation. I don't have such a fear anymore, at least for Octane/crypto. In the future, we can check how the regalloc is performing just by enabling logAirRegisterPressure. Also fixed some FTL codegen pathologies. We were using bitOr where we meant to use a conditional or. LLVM likes to canonicalize boolean expressions this way. B3, on the other hand, doesn't do this canonicalization and doesn't have logic to decompose it into sequences of branches. Also added strength reductions for checked arithmetic. It turns out that LLVM learned how to reduce checked multiply to unchecked multiply in some obvious cases that our existing DFG optimizations lacked. Ideally, our DFG integer range optimization phase would cover this. But the cases of interest were dead simple - the incoming values to the CheckMul were obviously too small to cause overflow. I added such reasoning to B3's strength reduction. Finally, this fixes some bugs with how we were handling subwidth spill slots. The register allocator was making two mistakes. First, it might cause a Width64 def or use of a 4-byte spill slot. In that case, it would extend the size of the spill slot to ensure that the use or def is safe. Second, it emulates ZDef on Tmp behavior by emitting a Move32 to initialize the high bits of a spill slot. But this is unsound because of the liveness semantics of spill slots. They cannot have more than one def to initialize their value. I fixed that by making allocateStack() be the thing that fixes ZDefs. That's a change to ZDef semantics: now, ZDef on an anonymous stack slot means that the high bits are zero-filled. I wasn't able to construct a test for this. It might be a hypothetical bug, but still, I like how this simplifies the register allocator. This is a ~0.7% speed-up on Octane. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3CheckSpecial.cpp: (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::commitHiddenBranch): Deleted. * b3/B3CheckSpecial.h: * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::fillStackmap): (JSC::B3::Air::LowerToAir::lower): * b3/B3StackmapValue.h: * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: * b3/air/AirArg.h: (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::stackAddr): (JSC::B3::Air::Arg::isValidScale): * b3/air/AirBasicBlock.cpp: (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::dumpHeader): (JSC::B3::Air::BasicBlock::dumpFooter): * b3/air/AirBasicBlock.h: * b3/air/AirCCallSpecial.cpp: (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): * b3/air/AirCode.h: (JSC::B3::Air::Code::lastPhaseName): (JSC::B3::Air::Code::setEnableRCRS): (JSC::B3::Air::Code::enableRCRS): * b3/air/AirCustom.cpp: (JSC::B3::Air::PatchCustom::isValidForm): (JSC::B3::Air::CCallCustom::isValidForm): * b3/air/AirCustom.h: (JSC::B3::Air::PatchCustom::isValidFormStatic): (JSC::B3::Air::PatchCustom::admitsStack): (JSC::B3::Air::PatchCustom::isValidForm): Deleted. * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::ShufflePair::dump): (JSC::B3::Air::createShuffle): (JSC::B3::Air::emitShuffle): * b3/air/AirEmitShuffle.h: * b3/air/AirFixObviousSpills.cpp: Added. (JSC::B3::Air::fixObviousSpills): * b3/air/AirFixObviousSpills.h: Added. * b3/air/AirFixSpillSlotZDef.h: Removed. * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirInst.h: * b3/air/AirInstInlines.h: (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::Inst::admitsStack): (JSC::B3::Air::isShiftValid): * b3/air/AirIteratedRegisterCoalescing.cpp: * b3/air/AirLiveness.h: (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::begin): (JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::end): (JSC::B3::Air::AbstractLiveness::LocalCalc::Iterable::contains): (JSC::B3::Air::AbstractLiveness::LocalCalc::live): (JSC::B3::Air::AbstractLiveness::LocalCalc::isLive): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): (JSC::B3::Air::AbstractLiveness::rawLiveAtHead): (JSC::B3::Air::AbstractLiveness::Iterable::begin): (JSC::B3::Air::AbstractLiveness::Iterable::end): (JSC::B3::Air::AbstractLiveness::Iterable::contains): (JSC::B3::Air::AbstractLiveness::liveAtTail): (JSC::B3::Air::AbstractLiveness::workset): * b3/air/AirLogRegisterPressure.cpp: Added. (JSC::B3::Air::logRegisterPressure): * b3/air/AirLogRegisterPressure.h: Added. * b3/air/AirOptimizeBlockOrder.cpp: (JSC::B3::Air::blocksInOptimizedOrder): (JSC::B3::Air::optimizeBlockOrder): * b3/air/AirOptimizeBlockOrder.h: * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * b3/air/AirReportUsedRegisters.h: * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirStackSlot.h: (JSC::B3::Air::StackSlot::isLocked): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::ensureSize): (JSC::B3::Air::StackSlot::alignment): * b3/air/AirValidate.cpp: * ftl/FTLB3Compile.cpp: (JSC::FTL::compile): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileArithMul): (JSC::FTL::DFG::LowerDFGToLLVM::compileArithDiv): (JSC::FTL::DFG::LowerDFGToLLVM::compileArithMod): * jit/RegisterSet.h: (JSC::RegisterSet::get): (JSC::RegisterSet::setAll): (JSC::RegisterSet::merge): (JSC::RegisterSet::filter): * runtime/Options.h: Source/WTF: * wtf/IndexSparseSet.h: (WTF::IndexSparseSet<OverflowHandler>::IndexSparseSet): (WTF::IndexSparseSet<OverflowHandler>::add): (WTF::IndexSparseSet<OverflowHandler>::remove): * wtf/StringPrintStream.h: (WTF::StringPrintStream::length): Canonical link: https://commits.webkit.org/171308@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-19 19:20:35 +00:00
size_t length() const { return m_next; }
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
WTF_EXPORT_PRIVATE CString toCString();
WTF_EXPORT_PRIVATE Expected<String, UTF8ConversionError> tryToString();
WTF_EXPORT_PRIVATE String toString();
JS parser incorrectly handles invalid utf8 in error messages. https://bugs.webkit.org/show_bug.cgi?id=158128 Reviewed by Saam Barati. Source/JavaScriptCore: The bug here was caused by us using PrintStream's toString method to produce the error message for a parse error, even though toString may produce a null string in the event of invalid utf8 that causes the error in first case. So when we try to create an error message containing the invalid character code, we set m_errorMessage to the null string, as that signals "no error" we don't stop parsing, and everything goes down hill from there. Now we use the new toStringWithLatin1Fallback so that we can always produce an error message, even if it contains invalid unicode. We also add an additional fallback so that we can guarantee an error message is set even if we're given a null string. There's a debug mode assertion to prevent anyone accidentally attempting to clear the message via setErrorMessage. * parser/Parser.cpp: (JSC::Parser<LexerType>::logError): * parser/Parser.h: (JSC::Parser::setErrorMessage): Source/WTF: Add a new toStringWithLatin1Fallback that simply uses String::fromUTF8WithLatin1Fallback, so we can avoid the standard String::fromUTF8 null return. * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::toStringWithLatin1Fallback): * wtf/StringPrintStream.h: LayoutTests: Add a testcase. * js/invalid-utf8-in-syntax-error-expected.txt: Added. * js/script-tests/invalid-utf8-in-syntax-error.js: Added. Canonical link: https://commits.webkit.org/176410@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-02 23:07:48 +00:00
WTF_EXPORT_PRIVATE String toStringWithLatin1Fallback();
Get rid of JavaScript exports file on AppleWin port. https://bugs.webkit.org/show_bug.cgi?id=117050. Reviewed by Darin Adler. This requires turning WTF into a shared library and adding the WTF_EXPORT_PRIVATE to some methods where it was missed. Start linking in WTF.lib now that it's a shared library. Also, delete the JavaScriptCoreExportGenerator folder and remove dependencies. * JavaScriptCore.vcxproj/JavaScriptCore.submit.sln: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.vcxproj/JavaScriptCoreCommon.props: * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGenerator.vcxproj.filters: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorBuildCmd.cmd: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorCommon.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorDebug.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorPostBuild.cmd: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorPreBuild.cmd: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorProduction.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExportGeneratorRelease.props: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/JavaScriptCoreExports.def.in: Removed. * JavaScriptCore.vcxproj/JavaScriptCoreExportGenerator/make-export-file-generator: Removed. * JavaScriptCore.vcxproj/jsc/jscCommon.props: * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj: * JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj.filters: * JavaScriptCore.vcxproj/testRegExp/testRegExpCommon.props: * JavaScriptCore.vcxproj/testapi/testapiCommon.props: * WTF.vcxproj/WTF.vcxproj: * WTF.vcxproj/WTFCommon.props: * wtf/DateMath.h: * wtf/ExportMacros.h: * wtf/FilePrintStream.h: * wtf/OSAllocator.h: * wtf/PageAllocationAligned.h: * wtf/Platform.h: * wtf/PrintStream.h: * wtf/StackBounds.h: * wtf/StringPrintStream.h: * wtf/ThreadSpecific.h: * wtf/WTFThreadData.h: * wtf/dtoa/cached-powers.h: * wtf/dtoa/double-conversion.h: * wtf/text/WTFString.h: * wtf/unicode/Collator.h: * wtf/unicode/UTF8.h: * WebKit.vcxproj/WebKit.sln: * WebKit.vcxproj/WebKit/WebKitCommon.props: * DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeCommon.props: * DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiffCommon.props: * TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPICommon.props: Canonical link: https://commits.webkit.org/135316@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-05-31 00:38:15 +00:00
WTF_EXPORT_PRIVATE void reset();
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
private:
void increaseSize(size_t);
char* m_buffer;
size_t m_next;
size_t m_size;
char m_inlineBuffer[128];
};
// Stringify any type T that has a WTF::printInternal(PrintStream&, const T&)
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
template<typename... Types>
CString toCString(const Types&... 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
{
StringPrintStream stream;
stream.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
return stream.toCString();
}
template<typename... Types>
String toString(const Types&... values)
{
StringPrintStream stream;
stream.print(values...);
return stream.toString();
}
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
} // namespace WTF
using WTF::StringPrintStream;
using WTF::toCString;
using WTF::toString;