haikuwebkit/Source/WTF/wtf/PrintStream.cpp

193 lines
4.8 KiB
C++
Raw Permalink Normal View History

Any function that can log things should be able to easily log them to a memory buffer as well https://bugs.webkit.org/show_bug.cgi?id=103000 Reviewed by Sam Weinig. Source/JavaScriptCore: Change all users of WTF::dataFile() to expect a PrintStream& rather than a FILE*. * bytecode/Operands.h: (JSC::OperandValueTraits::dump): (JSC::dumpOperands): (JSC): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::dump): * dfg/DFGAbstractState.h: (AbstractState): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGCommon.h: (JSC::DFG::NodeIndexTraits::dump): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): * dfg/DFGVariableEvent.cpp: (JSC::DFG::VariableEvent::dump): (JSC::DFG::VariableEvent::dumpFillInfo): (JSC::DFG::VariableEvent::dumpSpillInfo): * dfg/DFGVariableEvent.h: (VariableEvent): * disassembler/Disassembler.h: (JSC): (JSC::tryToDisassemble): * disassembler/UDis86Disassembler.cpp: (JSC::tryToDisassemble): Source/WTF: We have a number of places where we pass around a FILE* as a target to which to print some logging information. But the purpose of passing FILE* instead of always assuming that we should dump to stderr is that it may be sometimes useful to send the logging information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome to use it to send logging to a string, for example. We could get around this by using <iostream> and <sstream>, but so far this aspect of C++ has not been part of the WebKit coding conventions. Personally I find <iostream> awkward due to its abuse of operator overloading. So this patch introduces the PrintStream abstract class, which offers printf-like functionality while completely abstracting the destination and mechanism of the printing output. It would be trivial to implement a StringPrintStream, for example. This will feed into work on https://bugs.webkit.org/show_bug.cgi?id=102999. This also sets us up for creating templatized print() and println() methods that will allow us to say things like out.print("count = ", count, "\n"), but that is the topic of https://bugs.webkit.org/show_bug.cgi?id=103009. This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile() now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed to expect a PrintStream&. * GNUmakefile.list.am: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.cpp: (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLogString): * wtf/DataLog.h: (WTF): * wtf/FilePrintStream.cpp: Added. (WTF): (WTF::FilePrintStream::FilePrintStream): (WTF::FilePrintStream::~FilePrintStream): (WTF::FilePrintStream::vprintf): (WTF::FilePrintStream::flush): * wtf/FilePrintStream.h: Added. (WTF): (FilePrintStream): (WTF::FilePrintStream::file): * wtf/PrintStream.cpp: Added. (WTF): (WTF::PrintStream::PrintStream): (WTF::PrintStream::~PrintStream): (WTF::PrintStream::printf): (WTF::PrintStream::print): (WTF::PrintStream::println): (WTF::PrintStream::flush): (WTF::print): * wtf/PrintStream.h: Added. (WTF): (PrintStream): (WTF::print): (WTF::println): Canonical link: https://commits.webkit.org/121301@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-24 03:16:47 +00:00
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#include <wtf/PrintStream.h>
Any function that can log things should be able to easily log them to a memory buffer as well https://bugs.webkit.org/show_bug.cgi?id=103000 Reviewed by Sam Weinig. Source/JavaScriptCore: Change all users of WTF::dataFile() to expect a PrintStream& rather than a FILE*. * bytecode/Operands.h: (JSC::OperandValueTraits::dump): (JSC::dumpOperands): (JSC): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::dump): * dfg/DFGAbstractState.h: (AbstractState): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGCommon.h: (JSC::DFG::NodeIndexTraits::dump): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): * dfg/DFGVariableEvent.cpp: (JSC::DFG::VariableEvent::dump): (JSC::DFG::VariableEvent::dumpFillInfo): (JSC::DFG::VariableEvent::dumpSpillInfo): * dfg/DFGVariableEvent.h: (VariableEvent): * disassembler/Disassembler.h: (JSC): (JSC::tryToDisassemble): * disassembler/UDis86Disassembler.cpp: (JSC::tryToDisassemble): Source/WTF: We have a number of places where we pass around a FILE* as a target to which to print some logging information. But the purpose of passing FILE* instead of always assuming that we should dump to stderr is that it may be sometimes useful to send the logging information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome to use it to send logging to a string, for example. We could get around this by using <iostream> and <sstream>, but so far this aspect of C++ has not been part of the WebKit coding conventions. Personally I find <iostream> awkward due to its abuse of operator overloading. So this patch introduces the PrintStream abstract class, which offers printf-like functionality while completely abstracting the destination and mechanism of the printing output. It would be trivial to implement a StringPrintStream, for example. This will feed into work on https://bugs.webkit.org/show_bug.cgi?id=102999. This also sets us up for creating templatized print() and println() methods that will allow us to say things like out.print("count = ", count, "\n"), but that is the topic of https://bugs.webkit.org/show_bug.cgi?id=103009. This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile() now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed to expect a PrintStream&. * GNUmakefile.list.am: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.cpp: (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLogString): * wtf/DataLog.h: (WTF): * wtf/FilePrintStream.cpp: Added. (WTF): (WTF::FilePrintStream::FilePrintStream): (WTF::FilePrintStream::~FilePrintStream): (WTF::FilePrintStream::vprintf): (WTF::FilePrintStream::flush): * wtf/FilePrintStream.h: Added. (WTF): (FilePrintStream): (WTF::FilePrintStream::file): * wtf/PrintStream.cpp: Added. (WTF): (WTF::PrintStream::PrintStream): (WTF::PrintStream::~PrintStream): (WTF::PrintStream::printf): (WTF::PrintStream::print): (WTF::PrintStream::println): (WTF::PrintStream::flush): (WTF::print): * wtf/PrintStream.h: Added. (WTF): (PrintStream): (WTF::print): (WTF::println): Canonical link: https://commits.webkit.org/121301@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-24 03:16:47 +00:00
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
namespace WTF {
PrintStream::PrintStream() { }
PrintStream::~PrintStream() { } // Force the vtable to be in this module
void PrintStream::printf(const char* format, ...)
{
va_list argList;
va_start(argList, format);
vprintf(format, argList);
va_end(argList);
}
void PrintStream::printfVariableFormat(const char* format, ...)
{
Add IGNORE_WARNING_.* macros https://bugs.webkit.org/show_bug.cgi?id=188996 Reviewed by Michael Catanzaro. Source/JavaScriptCore: * API/JSCallbackObject.h: * API/tests/testapi.c: * assembler/LinkBuffer.h: (JSC::LinkBuffer::finalizeCodeWithDisassembly): * b3/B3LowerToAir.cpp: * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * bytecode/Opcode.h: (JSC::padOpcodeName): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::speculateNumber): (JSC::DFG::SpeculativeJIT::speculateMisc): * dfg/DFGSpeculativeJIT64.cpp: * ftl/FTLOutput.h: * jit/CCallHelpers.h: (JSC::CCallHelpers::calculatePokeOffset): * llint/LLIntData.cpp: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::slowPathLogF): * runtime/ConfigFile.cpp: (JSC::ConfigFile::canonicalizePaths): * runtime/JSDataViewPrototype.cpp: * runtime/JSGenericTypedArrayViewConstructor.h: * runtime/JSGenericTypedArrayViewPrototype.h: * runtime/Options.cpp: (JSC::Options::setAliasedOption): * tools/CodeProfiling.cpp: * wasm/WasmSections.h: * wasm/generateWasmValidateInlinesHeader.py: Source/WebCore: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::overrideAttachmentParent): (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper renderWidgetChildren]): (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): (-[WebAccessibilityObjectWrapper role]): (-[WebAccessibilityObjectWrapper roleDescription]): * bridge/objc/WebScriptObject.mm: * bridge/objc/objc_class.mm: (JSC::Bindings::ObjcClass::fieldNamed const): * crypto/CommonCryptoUtilities.cpp: (WebCore::getCommonCryptoDigestAlgorithm): * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: (WebCore::encryptAES_GCM): (WebCore::decyptAES_GCM): * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::wrapSerializedCryptoKey): (WebCore::unwrapSerializedCryptoKey): * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: * css/makeSelectorPseudoElementsMap.py: * editing/TextIterator.cpp: * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::takeFindStringFromSelection): (WebCore::Editor::replaceNodeFromPasteboard): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::paintContents): * platform/LocalizedStrings.cpp: (WebCore::formatLocalizedString): * platform/ScreenProperties.h: (WebCore::ScreenData::decode): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::stopMonitoringInput): * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::sharedDisplay): * platform/graphics/SurrogatePairAwareTextIterator.cpp: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::IGNORE_CLANG_WARNING_END): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::IGNORE_CLANG_WARNING_END): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayer::drawLayerContents): * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::createFrameImageAtIndex): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::GraphicsContext::drawLineForDocumentMarker): * platform/graphics/cocoa/WebGLLayer.h: (IGNORE_CLANG_WARNING): * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * platform/graphics/mac/IconMac.mm: (WebCore::Icon::Icon): * platform/graphics/mac/PDFDocumentImageMac.mm: (WebCore::PDFDocumentImage::drawPDFPage): * platform/graphics/mac/WebKitNSImageExtras.mm: (-[NSImage _web_lockFocusWithDeviceScaleFactor:]): * platform/ios/DragImageIOS.mm: * platform/mac/DragImageMac.mm: (WebCore::scaleDragImage): (WebCore::createDragImageForLink): * platform/mac/LegacyNSPasteboardTypes.h: * platform/mac/LocalCurrentGraphicsContext.mm: (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::createForCopyAndPaste): (WebCore::Pasteboard::createForDragAndDrop): (WebCore::setDragImageImpl): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::globalPoint): * platform/mac/SSLKeyGeneratorMac.mm: * platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): * platform/mac/WebPlaybackControlsManager.mm: * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): * platform/mediastream/RealtimeIncomingAudioSource.h: * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::reportErrorToClient): * platform/network/create-http-header-name-table: * platform/text/TextEncoding.cpp: * testing/MockLibWebRTCPeerConnection.h: * xml/XPathGrammar.cpp: Source/WebCore/PAL: * pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: (PAL::CryptoDigest::create): (PAL::CryptoDigest::addBytes): (PAL::CryptoDigest::computeHash): * pal/spi/cocoa/AVKitSPI.h: * pal/spi/cocoa/NSKeyedArchiverSPI.h: (insecurelyUnarchiveObjectFromData): * pal/spi/ios/MediaPlayerSPI.h: * pal/system/mac/PopupMenu.mm: (PAL::popUpMenu): * pal/system/mac/WebPanel.mm: (-[WebPanel init]): Source/WebKit: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::statelessCookieStorage): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSyncAllCookies): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::beginModal): * PluginProcess/mac/PluginProcessShim.mm: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::tryLoad): * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::initializeSandbox): * Shared/mac/ChildProcessMac.mm: (WebKit::compileAndApplySandboxSlowCase): * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::decode): * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_superAccessibilityAttributeValue:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunAsModal): * UIProcess/API/mac/WKView.mm: (-[WKView _web_superAccessibilityAttributeValue:]): * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm: (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextListTouchBarViewController initWithWebViewImpl:]): (WebKit::WebViewImpl::updateWindowAndViewFrames): (WebKit::WebViewImpl::sendDragEndToPage): (WebKit::WebViewImpl::startDrag): (WebKit::WebViewImpl::characterIndexForPoint): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::getPluginProcessSerialNumber): (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess): (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess): (WebKit::PluginProcessProxy::exitFullscreen): * UIProcess/ios/SmartMagnificationController.mm: * UIProcess/ios/WKGeolocationProviderIOS.mm: * UIProcess/ios/WKLegacyPDFView.mm: * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator _makeRoundedCorners]): * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]): * UIProcess/ios/forms/WKFormColorControl.mm: (-[WKColorPopover initWithView:]): * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKDateTimePopover initWithView:datePickerMode:]): * UIProcess/ios/forms/WKFormPopover.h: * UIProcess/ios/forms/WKFormPopover.mm: * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectPopover initWithView:hasGroups:]): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::screenToRootView): (WebKit::PageClientImpl::rootViewToScreen): * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _setAutodisplay:]): (-[WKPrintingView _drawPDFDocument:page:atPoint:]): (-[WKPrintingView _drawPreview:]): (-[WKPrintingView drawRect:]): * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]): (-[WKTextInputPanel _hasMarkedText]): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::initializeEventRecord): (WebKit::NetscapePlugin::sendComplexTextInput): (WebKit::makeCGLPresentLayerOpaque): (WebKit::NetscapePlugin::nullEventTimerFired): * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]): (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]): (WebKit::PDFPlugin::handleEditingCommand): (WebKit::PDFPlugin::setActiveAnnotation): (WebKit:: const): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::drawPDFPage): Source/WebKitLegacy/mac: * Carbon/CarbonUtils.m: (PoolCleaner): * Carbon/CarbonWindowAdapter.mm: (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): (-[CarbonWindowAdapter setViewsNeedDisplay:]): (-[CarbonWindowAdapter reconcileToCarbonWindowBounds]): (-[CarbonWindowAdapter _termWindowIfOwner]): (-[CarbonWindowAdapter _windowMovedToRect:]): (-[CarbonWindowAdapter setContentView:]): (-[CarbonWindowAdapter _handleRootBoundsChanged]): (-[CarbonWindowAdapter _handleContentBoundsChanged]): * Carbon/CarbonWindowFrame.m: (-[CarbonWindowFrame title]): * Carbon/HIViewAdapter.m: (+[HIViewAdapter getHIViewForNSView:]): * Carbon/HIWebView.mm: (overrideCGContext): (restoreCGContext): (Draw): * DOM/DOM.mm: * History/WebHistory.mm: (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): * History/WebHistoryItem.mm: (-[WebHistoryItem icon]): * Misc/WebKitNSStringExtras.mm: (-[NSString _web_drawAtPoint:font:textColor:]): * Misc/WebNSImageExtras.m: (-[NSImage _web_scaleToMaxSize:]): (-[NSImage _web_dissolveToFraction:]): * Misc/WebNSPasteboardExtras.mm: (+[NSPasteboard _web_setFindPasteboardString:withOwner:]): (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel loadNib]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::makeCurrentProcessFrontProcess): (WebKit::NetscapePluginHostProxy::makePluginHostProcessFrontProcess const): (WebKit::NetscapePluginHostProxy::isPluginHostProcessFrontProcess const): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::mouseEvent): * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView drawRect:]): * Plugins/Hosted/WebTextInputWindowController.m: (-[WebTextInputPanel _interpretKeyEvent:string:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView convertFromX:andY:space:toX:andY:space:]): * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _tryLoad]): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebNetscapePluginView sendDrawRectEvent:]): (-[WebNetscapePluginView drawRect:]): * Plugins/WebPluginController.mm: (WebKit_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_): (WebKit_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_): * WebCoreSupport/PopupMenuMac.mm: (PopupMenuMac::populate): * WebCoreSupport/WebAlternativeTextClient.h: * WebCoreSupport/WebDragClient.mm: (WebDragClient::startDrag): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::convertMainResourceLoadToDownload): (webGetNSImage): * WebInspector/WebNodeHighlight.mm: * WebInspector/WebNodeHighlightView.mm: (-[WebNodeHighlightView drawRect:]): * WebView/WebClipView.mm: (-[WebClipView initWithFrame:]): * WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): (-[WebFrame _drawRect:contentsOnly:]): (-[WebFrame accessibilityRoot]): * WebView/WebFullScreenController.mm: (-[WebFullScreenController enterFullScreen:]): (-[WebFullScreenController finishedEnterFullScreenAnimation:]): (-[WebFullScreenController exitFullScreen]): (-[WebFullScreenController finishedExitFullScreenAnimation:]): (-[WebFullScreenController _startEnterFullScreenAnimationWithDuration:]): (-[WebFullScreenController _startExitFullScreenAnimationWithDuration:]): * WebView/WebHTMLView.mm: (-[NSWindow _web_borderView]): (-[WebHTMLView _updateMouseoverWithFakeEvent]): (-[WebHTMLView _setAsideSubviews]): (-[WebHTMLView _autoscroll]): (-[WebHTMLView drawRect:]): (-[WebHTMLView mouseDown:]): (-[WebHTMLView mouseDragged:]): (-[WebHTMLView mouseUp:]): (-[WebHTMLView _endPrintModeAndRestoreWindowAutodisplay]): (-[WebHTMLView knowsPageRange:]): (-[WebHTMLView accessibilityHitTest:]): (-[WebHTMLView _fontAttributesFromFontPasteboard]): (-[WebHTMLView _colorAsString:]): (-[WebHTMLView copyFont:]): (-[WebHTMLView _executeSavedKeypressCommands]): (-[WebHTMLView attachRootLayer:]): (-[WebHTMLView textStorage]): (-[WebHTMLView _updateSelectionForInputManager]): * WebView/WebPDFView.mm: (_applicationInfoForMIMEType): (-[WebPDFView centerSelectionInVisibleArea:]): (-[WebPDFView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): (-[WebPDFView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): (-[WebPDFView _recursive:displayRectIgnoringOpacity:inContext:topView:]): (-[WebPDFView searchFor:direction:caseSensitive:wrap:startInSelection:]): * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): (-[WebTextCompletionController _placePopupWindow:]): * WebView/WebVideoFullscreenController.mm: * WebView/WebVideoFullscreenHUDWindowController.mm: (createMediaUIBackgroundView): * WebView/WebView.mm: (-[WebTextListTouchBarViewController initWithWebView:]): (-[WebView _dispatchTileDidDraw:]): (-[WebView encodeWithCoder:]): (-[WebView mainFrameIcon]): (LayerFlushController::flushLayers): * WebView/WebWindowAnimation.mm: (setScaledFrameForWindow): Source/WTF: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Compiler.h: * wtf/MD5.cpp: (WTF::MD5::MD5): (WTF::MD5::addBytes): (WTF::MD5::checksum): * wtf/PrintStream.cpp: (WTF::PrintStream::printfVariableFormat): * wtf/SHA1.cpp: (WTF::SHA1::SHA1): (WTF::SHA1::addBytes): (WTF::SHA1::computeHash): * wtf/ThreadingPthreads.cpp: * wtf/Vector.h: (WTF::VectorBuffer::endOfBuffer): * wtf/text/WTFString.cpp: (WTF::createWithFormatAndArguments): Canonical link: https://commits.webkit.org/204515@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-12 15:09:16 +00:00
ALLOW_NONLITERAL_FORMAT_BEGIN
IGNORE_GCC_WARNINGS_BEGIN("suggest-attribute=format")
va_list argList;
va_start(argList, format);
vprintf(format, argList);
va_end(argList);
Add IGNORE_WARNING_.* macros https://bugs.webkit.org/show_bug.cgi?id=188996 Reviewed by Michael Catanzaro. Source/JavaScriptCore: * API/JSCallbackObject.h: * API/tests/testapi.c: * assembler/LinkBuffer.h: (JSC::LinkBuffer::finalizeCodeWithDisassembly): * b3/B3LowerToAir.cpp: * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * bytecode/Opcode.h: (JSC::padOpcodeName): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::speculateNumber): (JSC::DFG::SpeculativeJIT::speculateMisc): * dfg/DFGSpeculativeJIT64.cpp: * ftl/FTLOutput.h: * jit/CCallHelpers.h: (JSC::CCallHelpers::calculatePokeOffset): * llint/LLIntData.cpp: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::slowPathLogF): * runtime/ConfigFile.cpp: (JSC::ConfigFile::canonicalizePaths): * runtime/JSDataViewPrototype.cpp: * runtime/JSGenericTypedArrayViewConstructor.h: * runtime/JSGenericTypedArrayViewPrototype.h: * runtime/Options.cpp: (JSC::Options::setAliasedOption): * tools/CodeProfiling.cpp: * wasm/WasmSections.h: * wasm/generateWasmValidateInlinesHeader.py: Source/WebCore: * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::overrideAttachmentParent): (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper renderWidgetChildren]): (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): (-[WebAccessibilityObjectWrapper role]): (-[WebAccessibilityObjectWrapper roleDescription]): * bridge/objc/WebScriptObject.mm: * bridge/objc/objc_class.mm: (JSC::Bindings::ObjcClass::fieldNamed const): * crypto/CommonCryptoUtilities.cpp: (WebCore::getCommonCryptoDigestAlgorithm): * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: (WebCore::encryptAES_GCM): (WebCore::decyptAES_GCM): * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::wrapSerializedCryptoKey): (WebCore::unwrapSerializedCryptoKey): * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: * css/makeSelectorPseudoElementsMap.py: * editing/TextIterator.cpp: * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::takeFindStringFromSelection): (WebCore::Editor::replaceNodeFromPasteboard): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::paintContents): * platform/LocalizedStrings.cpp: (WebCore::formatLocalizedString): * platform/ScreenProperties.h: (WebCore::ScreenData::decode): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::stopMonitoringInput): * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::sharedDisplay): * platform/graphics/SurrogatePairAwareTextIterator.cpp: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::IGNORE_CLANG_WARNING_END): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::IGNORE_CLANG_WARNING_END): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayer::drawLayerContents): * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::createFrameImageAtIndex): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::GraphicsContext::drawLineForDocumentMarker): * platform/graphics/cocoa/WebGLLayer.h: (IGNORE_CLANG_WARNING): * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * platform/graphics/mac/IconMac.mm: (WebCore::Icon::Icon): * platform/graphics/mac/PDFDocumentImageMac.mm: (WebCore::PDFDocumentImage::drawPDFPage): * platform/graphics/mac/WebKitNSImageExtras.mm: (-[NSImage _web_lockFocusWithDeviceScaleFactor:]): * platform/ios/DragImageIOS.mm: * platform/mac/DragImageMac.mm: (WebCore::scaleDragImage): (WebCore::createDragImageForLink): * platform/mac/LegacyNSPasteboardTypes.h: * platform/mac/LocalCurrentGraphicsContext.mm: (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::createForCopyAndPaste): (WebCore::Pasteboard::createForDragAndDrop): (WebCore::setDragImageImpl): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::globalPoint): * platform/mac/SSLKeyGeneratorMac.mm: * platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): * platform/mac/WebPlaybackControlsManager.mm: * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): * platform/mediastream/RealtimeIncomingAudioSource.h: * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::reportErrorToClient): * platform/network/create-http-header-name-table: * platform/text/TextEncoding.cpp: * testing/MockLibWebRTCPeerConnection.h: * xml/XPathGrammar.cpp: Source/WebCore/PAL: * pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: (PAL::CryptoDigest::create): (PAL::CryptoDigest::addBytes): (PAL::CryptoDigest::computeHash): * pal/spi/cocoa/AVKitSPI.h: * pal/spi/cocoa/NSKeyedArchiverSPI.h: (insecurelyUnarchiveObjectFromData): * pal/spi/ios/MediaPlayerSPI.h: * pal/system/mac/PopupMenu.mm: (PAL::popUpMenu): * pal/system/mac/WebPanel.mm: (-[WebPanel init]): Source/WebKit: * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: (WebKit::NetworkDataTaskCocoa::statelessCookieStorage): * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformSyncAllCookies): * PluginProcess/mac/PluginProcessMac.mm: (WebKit::beginModal): * PluginProcess/mac/PluginProcessShim.mm: * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::tryLoad): * Shared/ios/ChildProcessIOS.mm: (WebKit::ChildProcess::initializeSandbox): * Shared/mac/ChildProcessMac.mm: (WebKit::compileAndApplySandboxSlowCase): * Shared/mac/ColorSpaceData.mm: (WebKit::ColorSpaceData::decode): * Shared/mac/SandboxExtensionMac.mm: (WebKit::SandboxExtensionImpl::sandboxExtensionForType): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _web_superAccessibilityAttributeValue:]): * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunAsModal): * UIProcess/API/mac/WKView.mm: (-[WKView _web_superAccessibilityAttributeValue:]): * UIProcess/Cocoa/DownloadClient.mm: (WebKit::DownloadClient::decideDestinationWithSuggestedFilename): * UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm: (-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]): * UIProcess/Cocoa/NavigationState.mm: (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): * UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu): * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::platformInitializeWebProcess): * UIProcess/Cocoa/WebViewImpl.mm: (-[WKTextListTouchBarViewController initWithWebViewImpl:]): (WebKit::WebViewImpl::updateWindowAndViewFrames): (WebKit::WebViewImpl::sendDragEndToPage): (WebKit::WebViewImpl::startDrag): (WebKit::WebViewImpl::characterIndexForPoint): * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: (WebKit::PluginProcessProxy::getPluginProcessSerialNumber): (WebKit::PluginProcessProxy::makePluginProcessTheFrontProcess): (WebKit::PluginProcessProxy::makeUIProcessTheFrontProcess): (WebKit::PluginProcessProxy::exitFullscreen): * UIProcess/ios/SmartMagnificationController.mm: * UIProcess/ios/WKGeolocationProviderIOS.mm: * UIProcess/ios/WKLegacyPDFView.mm: * UIProcess/ios/WKPDFPageNumberIndicator.mm: (-[WKPDFPageNumberIndicator _makeRoundedCorners]): * UIProcess/ios/forms/WKAirPlayRoutePicker.mm: * UIProcess/ios/forms/WKFileUploadPanel.mm: (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]): * UIProcess/ios/forms/WKFormColorControl.mm: (-[WKColorPopover initWithView:]): * UIProcess/ios/forms/WKFormInputControl.mm: (-[WKDateTimePopover initWithView:datePickerMode:]): * UIProcess/ios/forms/WKFormPopover.h: * UIProcess/ios/forms/WKFormPopover.mm: * UIProcess/ios/forms/WKFormSelectPopover.mm: (-[WKSelectPopover initWithView:hasGroups:]): * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::screenToRootView): (WebKit::PageClientImpl::rootViewToScreen): * UIProcess/mac/WKFullScreenWindowController.mm: (-[WKFullScreenWindowController enterFullScreen:]): (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): (-[WKFullScreenWindowController exitFullScreen]): (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]): (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): * UIProcess/mac/WKPrintingView.mm: (-[WKPrintingView _setAutodisplay:]): (-[WKPrintingView _drawPDFDocument:page:atPoint:]): (-[WKPrintingView _drawPreview:]): (-[WKPrintingView drawRect:]): * UIProcess/mac/WKTextInputWindowController.mm: (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]): (-[WKTextInputPanel _hasMarkedText]): * UIProcess/mac/WebPopupMenuProxyMac.mm: (WebKit::WebPopupMenuProxyMac::showPopupMenu): * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: (WebKit::initializeEventRecord): (WebKit::NetscapePlugin::sendComplexTextInput): (WebKit::makeCGLPresentLayerOpaque): (WebKit::NetscapePlugin::nullEventTimerFired): * WebProcess/Plugins/PDF/PDFPlugin.mm: (-[WKPDFPluginAccessibilityObject accessibilityFocusedUIElement]): (-[WKPDFLayerControllerDelegate writeItemsToPasteboard:withTypes:]): (WebKit::PDFPlugin::handleEditingCommand): (WebKit::PDFPlugin::setActiveAnnotation): (WebKit:: const): * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h: * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: (WebKit::PDFPluginTextAnnotation::createAnnotationElement): * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm: (WebKit::convertImageToBitmap): (WebKit::WebDragClient::declareAndWriteDragImage): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::drawPDFPage): Source/WebKitLegacy/mac: * Carbon/CarbonUtils.m: (PoolCleaner): * Carbon/CarbonWindowAdapter.mm: (-[CarbonWindowAdapter initWithCarbonWindowRef:takingOwnership:disableOrdering:carbon:]): (-[CarbonWindowAdapter setViewsNeedDisplay:]): (-[CarbonWindowAdapter reconcileToCarbonWindowBounds]): (-[CarbonWindowAdapter _termWindowIfOwner]): (-[CarbonWindowAdapter _windowMovedToRect:]): (-[CarbonWindowAdapter setContentView:]): (-[CarbonWindowAdapter _handleRootBoundsChanged]): (-[CarbonWindowAdapter _handleContentBoundsChanged]): * Carbon/CarbonWindowFrame.m: (-[CarbonWindowFrame title]): * Carbon/HIViewAdapter.m: (+[HIViewAdapter getHIViewForNSView:]): * Carbon/HIWebView.mm: (overrideCGContext): (restoreCGContext): (Draw): * DOM/DOM.mm: * History/WebHistory.mm: (-[WebHistoryPrivate loadHistoryGutsFromURL:savedItemsCount:collectDiscardedItemsInto:error:]): * History/WebHistoryItem.mm: (-[WebHistoryItem icon]): * Misc/WebKitNSStringExtras.mm: (-[NSString _web_drawAtPoint:font:textColor:]): * Misc/WebNSImageExtras.m: (-[NSImage _web_scaleToMaxSize:]): (-[NSImage _web_dissolveToFraction:]): * Misc/WebNSPasteboardExtras.mm: (+[NSPasteboard _web_setFindPasteboardString:withOwner:]): (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]): * Panels/WebAuthenticationPanel.m: (-[WebAuthenticationPanel loadNib]): * Plugins/Hosted/NetscapePluginHostManager.mm: (WebKit::NetscapePluginHostManager::spawnPluginHost): (WebKit::NetscapePluginHostManager::didCreateWindow): * Plugins/Hosted/NetscapePluginHostProxy.mm: (WebKit::NetscapePluginHostProxy::makeCurrentProcessFrontProcess): (WebKit::NetscapePluginHostProxy::makePluginHostProcessFrontProcess const): (WebKit::NetscapePluginHostProxy::isPluginHostProcessFrontProcess const): * Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::mouseEvent): * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView drawRect:]): * Plugins/Hosted/WebTextInputWindowController.m: (-[WebTextInputPanel _interpretKeyEvent:string:]): * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView convertFromX:andY:space:toX:andY:space:]): * Plugins/WebNetscapePluginPackage.mm: (-[WebNetscapePluginPackage _tryLoad]): * Plugins/WebNetscapePluginView.mm: (-[WebNetscapePluginView saveAndSetNewPortStateForUpdate:]): (-[WebNetscapePluginView sendDrawRectEvent:]): (-[WebNetscapePluginView drawRect:]): * Plugins/WebPluginController.mm: (WebKit_TSUpdateCheck_alertDidEnd_returnCode_contextInfo_): (WebKit_NSAlert_beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_): * WebCoreSupport/PopupMenuMac.mm: (PopupMenuMac::populate): * WebCoreSupport/WebAlternativeTextClient.h: * WebCoreSupport/WebDragClient.mm: (WebDragClient::startDrag): * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::convertMainResourceLoadToDownload): (webGetNSImage): * WebInspector/WebNodeHighlight.mm: * WebInspector/WebNodeHighlightView.mm: (-[WebNodeHighlightView drawRect:]): * WebView/WebClipView.mm: (-[WebClipView initWithFrame:]): * WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): (-[WebFrame _drawRect:contentsOnly:]): (-[WebFrame accessibilityRoot]): * WebView/WebFullScreenController.mm: (-[WebFullScreenController enterFullScreen:]): (-[WebFullScreenController finishedEnterFullScreenAnimation:]): (-[WebFullScreenController exitFullScreen]): (-[WebFullScreenController finishedExitFullScreenAnimation:]): (-[WebFullScreenController _startEnterFullScreenAnimationWithDuration:]): (-[WebFullScreenController _startExitFullScreenAnimationWithDuration:]): * WebView/WebHTMLView.mm: (-[NSWindow _web_borderView]): (-[WebHTMLView _updateMouseoverWithFakeEvent]): (-[WebHTMLView _setAsideSubviews]): (-[WebHTMLView _autoscroll]): (-[WebHTMLView drawRect:]): (-[WebHTMLView mouseDown:]): (-[WebHTMLView mouseDragged:]): (-[WebHTMLView mouseUp:]): (-[WebHTMLView _endPrintModeAndRestoreWindowAutodisplay]): (-[WebHTMLView knowsPageRange:]): (-[WebHTMLView accessibilityHitTest:]): (-[WebHTMLView _fontAttributesFromFontPasteboard]): (-[WebHTMLView _colorAsString:]): (-[WebHTMLView copyFont:]): (-[WebHTMLView _executeSavedKeypressCommands]): (-[WebHTMLView attachRootLayer:]): (-[WebHTMLView textStorage]): (-[WebHTMLView _updateSelectionForInputManager]): * WebView/WebPDFView.mm: (_applicationInfoForMIMEType): (-[WebPDFView centerSelectionInVisibleArea:]): (-[WebPDFView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]): (-[WebPDFView _recursiveDisplayAllDirtyWithLockFocus:visRect:]): (-[WebPDFView _recursive:displayRectIgnoringOpacity:inContext:topView:]): (-[WebPDFView searchFor:direction:caseSensitive:wrap:startInSelection:]): * WebView/WebTextCompletionController.mm: (-[WebTextCompletionController _buildUI]): (-[WebTextCompletionController _placePopupWindow:]): * WebView/WebVideoFullscreenController.mm: * WebView/WebVideoFullscreenHUDWindowController.mm: (createMediaUIBackgroundView): * WebView/WebView.mm: (-[WebTextListTouchBarViewController initWithWebView:]): (-[WebView _dispatchTileDidDraw:]): (-[WebView encodeWithCoder:]): (-[WebView mainFrameIcon]): (LayerFlushController::flushLayers): * WebView/WebWindowAnimation.mm: (setScaledFrameForWindow): Source/WTF: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Compiler.h: * wtf/MD5.cpp: (WTF::MD5::MD5): (WTF::MD5::addBytes): (WTF::MD5::checksum): * wtf/PrintStream.cpp: (WTF::PrintStream::printfVariableFormat): * wtf/SHA1.cpp: (WTF::SHA1::SHA1): (WTF::SHA1::addBytes): (WTF::SHA1::computeHash): * wtf/ThreadingPthreads.cpp: * wtf/Vector.h: (WTF::VectorBuffer::endOfBuffer): * wtf/text/WTFString.cpp: (WTF::createWithFormatAndArguments): Canonical link: https://commits.webkit.org/204515@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-12 15:09:16 +00:00
IGNORE_GCC_WARNINGS_END
ALLOW_NONLITERAL_FORMAT_END
}
Any function that can log things should be able to easily log them to a memory buffer as well https://bugs.webkit.org/show_bug.cgi?id=103000 Reviewed by Sam Weinig. Source/JavaScriptCore: Change all users of WTF::dataFile() to expect a PrintStream& rather than a FILE*. * bytecode/Operands.h: (JSC::OperandValueTraits::dump): (JSC::dumpOperands): (JSC): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::dump): * dfg/DFGAbstractState.h: (AbstractState): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGCommon.h: (JSC::DFG::NodeIndexTraits::dump): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): * dfg/DFGVariableEvent.cpp: (JSC::DFG::VariableEvent::dump): (JSC::DFG::VariableEvent::dumpFillInfo): (JSC::DFG::VariableEvent::dumpSpillInfo): * dfg/DFGVariableEvent.h: (VariableEvent): * disassembler/Disassembler.h: (JSC): (JSC::tryToDisassemble): * disassembler/UDis86Disassembler.cpp: (JSC::tryToDisassemble): Source/WTF: We have a number of places where we pass around a FILE* as a target to which to print some logging information. But the purpose of passing FILE* instead of always assuming that we should dump to stderr is that it may be sometimes useful to send the logging information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome to use it to send logging to a string, for example. We could get around this by using <iostream> and <sstream>, but so far this aspect of C++ has not been part of the WebKit coding conventions. Personally I find <iostream> awkward due to its abuse of operator overloading. So this patch introduces the PrintStream abstract class, which offers printf-like functionality while completely abstracting the destination and mechanism of the printing output. It would be trivial to implement a StringPrintStream, for example. This will feed into work on https://bugs.webkit.org/show_bug.cgi?id=102999. This also sets us up for creating templatized print() and println() methods that will allow us to say things like out.print("count = ", count, "\n"), but that is the topic of https://bugs.webkit.org/show_bug.cgi?id=103009. This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile() now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed to expect a PrintStream&. * GNUmakefile.list.am: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.cpp: (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLogString): * wtf/DataLog.h: (WTF): * wtf/FilePrintStream.cpp: Added. (WTF): (WTF::FilePrintStream::FilePrintStream): (WTF::FilePrintStream::~FilePrintStream): (WTF::FilePrintStream::vprintf): (WTF::FilePrintStream::flush): * wtf/FilePrintStream.h: Added. (WTF): (FilePrintStream): (WTF::FilePrintStream::file): * wtf/PrintStream.cpp: Added. (WTF): (WTF::PrintStream::PrintStream): (WTF::PrintStream::~PrintStream): (WTF::PrintStream::printf): (WTF::PrintStream::print): (WTF::PrintStream::println): (WTF::PrintStream::flush): (WTF::print): * wtf/PrintStream.h: Added. (WTF): (PrintStream): (WTF::print): (WTF::println): Canonical link: https://commits.webkit.org/121301@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-24 03:16:47 +00:00
void PrintStream::flush()
{
}
PrintStream& PrintStream::begin()
{
return *this;
}
void PrintStream::end()
{
}
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
void printInternal(PrintStream& out, const char* string)
{
out.printf("%s", string);
}
static void printExpectedCStringHelper(PrintStream& out, const char* type, Expected<CString, UTF8ConversionError> expectedCString)
{
if (UNLIKELY(!expectedCString)) {
if (expectedCString.error() == UTF8ConversionError::OutOfMemory) {
printInternal(out, "(Out of memory while converting ");
printInternal(out, type);
printInternal(out, " to utf8)");
} else {
printInternal(out, "(failed to convert ");
printInternal(out, type);
printInternal(out, " to utf8)");
}
return;
}
printInternal(out, expectedCString.value());
}
CachedScript could have a copy-free path for all-ASCII scripts. <https://webkit.org/b/152203> Source/JavaScriptCore: Reviewed by Antti Koivisto. Make SourceProvider vend a StringView instead of a String. This relaxes the promises that providers have to make about string lifetimes. This means that on the WebCore side, CachedScript is free to cache a String internally, while only ever exposing it as a temporary StringView. A few extra copies (CPU, not memory) are introduced, none of them on hot paths. * API/JSScriptRef.cpp: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::sourceCodeForTools): (JSC::CodeBlock::dumpSource): * inspector/ScriptDebugServer.cpp: (Inspector::ScriptDebugServer::dispatchDidParseSource): (Inspector::ScriptDebugServer::dispatchFailedToParseSource): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): * jsc.cpp: (functionFindTypeForExpression): (functionHasBasicBlockExecuted): (functionBasicBlockExecutionCount): * parser/Lexer.cpp: (JSC::Lexer<T>::setCode): * parser/Lexer.h: (JSC::Lexer<LChar>::setCodeStart): (JSC::Lexer<UChar>::setCodeStart): * parser/Parser.h: (JSC::Parser::getToken): * parser/SourceCode.cpp: (JSC::SourceCode::toUTF8): * parser/SourceCode.h: (JSC::SourceCode::hash): (JSC::SourceCode::view): (JSC::SourceCode::toString): Deleted. * parser/SourceCodeKey.h: (JSC::SourceCodeKey::SourceCodeKey): (JSC::SourceCodeKey::string): * parser/SourceProvider.h: (JSC::SourceProvider::getRange): * runtime/Completion.cpp: (JSC::loadAndEvaluateModule): (JSC::loadModule): * runtime/ErrorInstance.cpp: (JSC::appendSourceToError): * runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncToString): * tools/FunctionOverrides.cpp: (JSC::initializeOverrideInfo): (JSC::FunctionOverrides::initializeOverrideFor): Source/WebCore: Reviewed by ANtti Koivisto. Many (if not most) of script resources on the web contain nothing but ASCII characters. Such resources, when streamed through a text decoder, will yield the exact same byte sequence, except in anonymous heap memory instead of delicious file-backed pages. Care is taken to ensure that the wrapper StringImpl is updated to target newly cached resource data if an asynchronous caching notification comes in. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::tryReplaceEncodedData): * loader/cache/CachedResource.h: (WebCore::CachedResource::didReplaceSharedBufferContents): * loader/cache/CachedScript.cpp: (WebCore::encodingMayBeAllASCII): (WebCore::CachedScript::script): (WebCore::CachedScript::didReplaceSharedBufferContents): * loader/cache/CachedScript.h: * platform/SharedBuffer.h: * platform/cf/SharedBufferCF.cpp: (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Canonical link: https://commits.webkit.org/170343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-13 20:03:24 +00:00
void printInternal(PrintStream& out, const StringView& string)
{
printExpectedCStringHelper(out, "StringView", string.tryGetUtf8());
CachedScript could have a copy-free path for all-ASCII scripts. <https://webkit.org/b/152203> Source/JavaScriptCore: Reviewed by Antti Koivisto. Make SourceProvider vend a StringView instead of a String. This relaxes the promises that providers have to make about string lifetimes. This means that on the WebCore side, CachedScript is free to cache a String internally, while only ever exposing it as a temporary StringView. A few extra copies (CPU, not memory) are introduced, none of them on hot paths. * API/JSScriptRef.cpp: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::sourceCodeForTools): (JSC::CodeBlock::dumpSource): * inspector/ScriptDebugServer.cpp: (Inspector::ScriptDebugServer::dispatchDidParseSource): (Inspector::ScriptDebugServer::dispatchFailedToParseSource): * interpreter/Interpreter.cpp: (JSC::Interpreter::execute): * jsc.cpp: (functionFindTypeForExpression): (functionHasBasicBlockExecuted): (functionBasicBlockExecutionCount): * parser/Lexer.cpp: (JSC::Lexer<T>::setCode): * parser/Lexer.h: (JSC::Lexer<LChar>::setCodeStart): (JSC::Lexer<UChar>::setCodeStart): * parser/Parser.h: (JSC::Parser::getToken): * parser/SourceCode.cpp: (JSC::SourceCode::toUTF8): * parser/SourceCode.h: (JSC::SourceCode::hash): (JSC::SourceCode::view): (JSC::SourceCode::toString): Deleted. * parser/SourceCodeKey.h: (JSC::SourceCodeKey::SourceCodeKey): (JSC::SourceCodeKey::string): * parser/SourceProvider.h: (JSC::SourceProvider::getRange): * runtime/Completion.cpp: (JSC::loadAndEvaluateModule): (JSC::loadModule): * runtime/ErrorInstance.cpp: (JSC::appendSourceToError): * runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncToString): * tools/FunctionOverrides.cpp: (JSC::initializeOverrideInfo): (JSC::FunctionOverrides::initializeOverrideFor): Source/WebCore: Reviewed by ANtti Koivisto. Many (if not most) of script resources on the web contain nothing but ASCII characters. Such resources, when streamed through a text decoder, will yield the exact same byte sequence, except in anonymous heap memory instead of delicious file-backed pages. Care is taken to ensure that the wrapper StringImpl is updated to target newly cached resource data if an asynchronous caching notification comes in. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::tryReplaceEncodedData): * loader/cache/CachedResource.h: (WebCore::CachedResource::didReplaceSharedBufferContents): * loader/cache/CachedScript.cpp: (WebCore::encodingMayBeAllASCII): (WebCore::CachedScript::script): (WebCore::CachedScript::didReplaceSharedBufferContents): * loader/cache/CachedScript.h: * platform/SharedBuffer.h: * platform/cf/SharedBufferCF.cpp: (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Canonical link: https://commits.webkit.org/170343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-13 20:03:24 +00:00
}
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
void printInternal(PrintStream& out, const CString& string)
{
printInternal(out, string.data());
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
}
void printInternal(PrintStream& out, const String& string)
{
printExpectedCStringHelper(out, "String", string.tryGetUtf8());
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
}
fourthTier: DFG tries to ref/deref StringImpls in a ton of places https://bugs.webkit.org/show_bug.cgi?id=115300 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Change any code transitively called from DFG compilation to use StringImpl* directly instead of String, Identifier, or PropertyName. I use the convention of passing "StringImpl* uid" instead of an Identifier or PropertyName. Switch over any code transitively called from DFG compilation to use CStrings whenever possible for all of its debug dumping. This makes it possible to compile things without hitting the ref/deref assertion in StringImpl. * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::inferredName): (JSC::CodeBlock::sourceCodeForTools): (JSC::CodeBlock::sourceCodeOnOneLine): (JSC::constantName): (JSC::idName): (JSC::CodeBlock::registerName): (JSC::regexpToSourceString): (JSC::regexpName): (JSC::pointerToSourceString): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dumpBytecode): * bytecode/CodeBlock.h: (CodeBlock): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::CodeBlockHash): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::inferredName): * bytecode/CodeOrigin.h: (InlineCallFrame): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC::GetByIdStatus::computeForChain): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC): (GetByIdStatus): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (JSC): (PutByIdStatus): * bytecode/ReduceWhitespace.cpp: (JSC::reduceWhitespace): * bytecode/ReduceWhitespace.h: (JSC): * bytecode/ResolveGlobalStatus.cpp: (JSC::computeForStructure): (JSC::ResolveGlobalStatus::computeFor): * bytecode/ResolveGlobalStatus.h: (JSC): (ResolveGlobalStatus): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::executeEffects): * dfg/DFGByteCodeParser.cpp: (ByteCodeParser): (JSC::DFG::ByteCodeParser::parseResolveOperations): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDesiredIdentifiers.cpp: Added. (DFG): (JSC::DFG::DesiredIdentifiers::DesiredIdentifiers): (JSC::DFG::DesiredIdentifiers::~DesiredIdentifiers): (JSC::DFG::DesiredIdentifiers::addLazily): (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredIdentifiers.h: Added. (DFG): (DesiredIdentifiers): (JSC::DFG::DesiredIdentifiers::numberOfIdentifiers): (JSC::DFG::DesiredIdentifiers::at): (JSC::DFG::DesiredIdentifiers::operator[]): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::isStringPrototypeMethodSane): (JSC::DFG::FixupPhase::canOptimizeStringObjectAccess): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGRepatch.cpp: (JSC::DFG::tryBuildGetByIDList): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::identifierUID): (JSC::DFG::SpeculativeJIT::callOperation): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::cachedGetById): (JSC::DFG::SpeculativeJIT::cachedPutById): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::cachedGetById): (JSC::DFG::SpeculativeJIT::cachedPutById): (JSC::DFG::SpeculativeJIT::compile): * parser/SourceCode.cpp: Added. (JSC): (JSC::SourceCode::toUTF8): * parser/SourceCode.h: (SourceCode): * profiler/ProfilerBytecodes.cpp: (JSC::Profiler::Bytecodes::toJS): * profiler/ProfilerBytecodes.h: (JSC::Profiler::Bytecodes::inferredName): (JSC::Profiler::Bytecodes::sourceCode): (Bytecodes): * runtime/Identifier.h: (JSC::Identifier::utf8): (JSC): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransitionToExistingStructureImpl): (JSC::Structure::addPropertyTransitionToExistingStructure): (JSC::Structure::addPropertyTransitionToExistingStructureConcurrently): (JSC::Structure::getConcurrently): (JSC::Structure::prototypeChainMayInterceptStoreTo): (JSC): * runtime/Structure.h: (Structure): * runtime/StructureInlines.h: (JSC::Structure::getConcurrently): Source/WTF: Reviewed by Geoffrey Garen. Make it possible to do more things directly to StringImpl*'s, including being able to directly do utf8 conversion on a substring without creating the substring first. Add assertions to StringImpl that it isn't being ref/deref'd from the compilation thread. * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (WTF): (WTF::printInternal): * wtf/StringPrintStream.h: (WTF): (WTF::toCString): * wtf/text/StringImpl.cpp: (WTF::StringImpl::utf8ForRange): (WTF::StringImpl::utf8): (WTF): * wtf/text/StringImpl.h: (StringImpl): (WTF::StringImpl::hasAtLeastOneRef): (WTF::StringImpl::ref): (WTF::StringImpl::deref): Canonical link: https://commits.webkit.org/136926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:59:29 +00:00
void printInternal(PrintStream& out, const StringImpl* string)
{
if (!string) {
printInternal(out, "(null StringImpl*)");
return;
}
printExpectedCStringHelper(out, "StringImpl*", string->tryGetUtf8());
fourthTier: DFG tries to ref/deref StringImpls in a ton of places https://bugs.webkit.org/show_bug.cgi?id=115300 Source/JavaScriptCore: Reviewed by Geoffrey Garen. Change any code transitively called from DFG compilation to use StringImpl* directly instead of String, Identifier, or PropertyName. I use the convention of passing "StringImpl* uid" instead of an Identifier or PropertyName. Switch over any code transitively called from DFG compilation to use CStrings whenever possible for all of its debug dumping. This makes it possible to compile things without hitting the ref/deref assertion in StringImpl. * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::inferredName): (JSC::CodeBlock::sourceCodeForTools): (JSC::CodeBlock::sourceCodeOnOneLine): (JSC::constantName): (JSC::idName): (JSC::CodeBlock::registerName): (JSC::regexpToSourceString): (JSC::regexpName): (JSC::pointerToSourceString): (JSC::CodeBlock::printUnaryOp): (JSC::CodeBlock::printBinaryOp): (JSC::CodeBlock::printConditionalJump): (JSC::CodeBlock::printGetByIdOp): (JSC::dumpStructure): (JSC::CodeBlock::printCallOp): (JSC::CodeBlock::printPutByIdOp): (JSC::CodeBlock::printStructure): (JSC::CodeBlock::printStructures): (JSC::CodeBlock::dumpBytecode): * bytecode/CodeBlock.h: (CodeBlock): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::CodeBlockHash): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::inferredName): * bytecode/CodeOrigin.h: (InlineCallFrame): * bytecode/GetByIdStatus.cpp: (JSC::GetByIdStatus::computeFromLLInt): (JSC::GetByIdStatus::computeForChain): (JSC::GetByIdStatus::computeFor): * bytecode/GetByIdStatus.h: (JSC): (GetByIdStatus): * bytecode/PutByIdStatus.cpp: (JSC::PutByIdStatus::computeFromLLInt): (JSC::PutByIdStatus::computeFor): * bytecode/PutByIdStatus.h: (JSC): (PutByIdStatus): * bytecode/ReduceWhitespace.cpp: (JSC::reduceWhitespace): * bytecode/ReduceWhitespace.h: (JSC): * bytecode/ResolveGlobalStatus.cpp: (JSC::computeForStructure): (JSC::ResolveGlobalStatus::computeFor): * bytecode/ResolveGlobalStatus.h: (JSC): (ResolveGlobalStatus): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::executeEffects): * dfg/DFGByteCodeParser.cpp: (ByteCodeParser): (JSC::DFG::ByteCodeParser::parseResolveOperations): (JSC::DFG::ByteCodeParser::parseBlock): (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::foldConstants): * dfg/DFGDesiredIdentifiers.cpp: Added. (DFG): (JSC::DFG::DesiredIdentifiers::DesiredIdentifiers): (JSC::DFG::DesiredIdentifiers::~DesiredIdentifiers): (JSC::DFG::DesiredIdentifiers::addLazily): (JSC::DFG::DesiredIdentifiers::reallyAdd): * dfg/DFGDesiredIdentifiers.h: Added. (DFG): (DesiredIdentifiers): (JSC::DFG::DesiredIdentifiers::numberOfIdentifiers): (JSC::DFG::DesiredIdentifiers::at): (JSC::DFG::DesiredIdentifiers::operator[]): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): (JSC::DFG::FixupPhase::isStringPrototypeMethodSane): (JSC::DFG::FixupPhase::canOptimizeStringObjectAccess): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dump): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOperations.cpp: * dfg/DFGOperations.h: * dfg/DFGRepatch.cpp: (JSC::DFG::tryBuildGetByIDList): * dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::identifierUID): (JSC::DFG::SpeculativeJIT::callOperation): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::cachedGetById): (JSC::DFG::SpeculativeJIT::cachedPutById): (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::cachedGetById): (JSC::DFG::SpeculativeJIT::cachedPutById): (JSC::DFG::SpeculativeJIT::compile): * parser/SourceCode.cpp: Added. (JSC): (JSC::SourceCode::toUTF8): * parser/SourceCode.h: (SourceCode): * profiler/ProfilerBytecodes.cpp: (JSC::Profiler::Bytecodes::toJS): * profiler/ProfilerBytecodes.h: (JSC::Profiler::Bytecodes::inferredName): (JSC::Profiler::Bytecodes::sourceCode): (Bytecodes): * runtime/Identifier.h: (JSC::Identifier::utf8): (JSC): * runtime/Structure.cpp: (JSC::Structure::addPropertyTransitionToExistingStructureImpl): (JSC::Structure::addPropertyTransitionToExistingStructure): (JSC::Structure::addPropertyTransitionToExistingStructureConcurrently): (JSC::Structure::getConcurrently): (JSC::Structure::prototypeChainMayInterceptStoreTo): (JSC): * runtime/Structure.h: (Structure): * runtime/StructureInlines.h: (JSC::Structure::getConcurrently): Source/WTF: Reviewed by Geoffrey Garen. Make it possible to do more things directly to StringImpl*'s, including being able to directly do utf8 conversion on a substring without creating the substring first. Add assertions to StringImpl that it isn't being ref/deref'd from the compilation thread. * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (WTF): (WTF::printInternal): * wtf/StringPrintStream.h: (WTF): (WTF::toCString): * wtf/text/StringImpl.cpp: (WTF::StringImpl::utf8ForRange): (WTF::StringImpl::utf8): (WTF): * wtf/text/StringImpl.h: (StringImpl): (WTF::StringImpl::hasAtLeastOneRef): (WTF::StringImpl::ref): (WTF::StringImpl::deref): Canonical link: https://commits.webkit.org/136926@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 03:59:29 +00:00
}
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
void printInternal(PrintStream& out, bool value)
{
out.print(boolForPrinting(value));
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
}
void printInternal(PrintStream& out, int value)
{
out.printf("%d", value);
}
void printInternal(PrintStream& out, unsigned value)
{
out.printf("%u", value);
}
void printInternal(PrintStream& out, signed char value)
{
out.printf("%d", static_cast<int>(value));
}
void printInternal(PrintStream& out, unsigned char value)
{
out.printf("%u", static_cast<unsigned>(value));
}
void printInternal(PrintStream& out, short value)
{
out.printf("%d", static_cast<int>(value));
}
void printInternal(PrintStream& out, unsigned short value)
{
out.printf("%u", static_cast<unsigned>(value));
}
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
void printInternal(PrintStream& out, long value)
{
out.printf("%ld", value);
}
void printInternal(PrintStream& out, unsigned long value)
{
out.printf("%lu", value);
}
void printInternal(PrintStream& out, long long value)
{
out.printf("%lld", value);
}
void printInternal(PrintStream& out, unsigned long long value)
{
out.printf("%llu", value);
}
void printInternal(PrintStream& out, float value)
{
printInternal(out, static_cast<double>(value));
It should be possible to say dataLog("count = ", count, "\n") instead of dataLogF("count = %d\n", count) https://bugs.webkit.org/show_bug.cgi?id=103009 Reviewed by Michael Saboff. Source/JavaScriptCore: Instead of converting all of JSC to use the new dataLog()/print() methods, I just changed one place: dumping of abstract values. This is mainly just to ensure that the code I added to WTF is actually doing things. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): (WTF): (WTF::printInternal): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): (WTF): (WTF::printInternal): Source/WTF: Added the ability to use out.print(...) and dataLog(...) variadically and with WTF::printInternal(PrintStream&, const T&) overloads for any type T that you want to be able to pass as an argument to out.print() or dataLog(). Also added one example class for doing this: RawPointer, which can be used to force a pointer to be printed as "%p" rather than matching any overloads that you might want to introduce. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.h: (WTF): (WTF::dataLog): * wtf/PrintStream.cpp: (WTF::printInternal): (WTF): * wtf/PrintStream.h: (PrintStream): (WTF::PrintStream::print): (WTF): * wtf/RawPointer.h: Added. (WTF): (RawPointer): (WTF::RawPointer::RawPointer): (WTF::RawPointer::value): Canonical link: https://commits.webkit.org/121689@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-28 22:59:35 +00:00
}
void printInternal(PrintStream& out, double value)
{
out.printf("%lf", value);
}
void printInternal(PrintStream& out, RawPointer value)
{
out.printf("%p", value.value());
}
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
void dumpCharacter(PrintStream& out, char value)
{
out.printf("%c", value);
}
Any function that can log things should be able to easily log them to a memory buffer as well https://bugs.webkit.org/show_bug.cgi?id=103000 Reviewed by Sam Weinig. Source/JavaScriptCore: Change all users of WTF::dataFile() to expect a PrintStream& rather than a FILE*. * bytecode/Operands.h: (JSC::OperandValueTraits::dump): (JSC::dumpOperands): (JSC): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::dump): * dfg/DFGAbstractState.h: (AbstractState): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGCommon.h: (JSC::DFG::NodeIndexTraits::dump): * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::dump): * dfg/DFGVariableEvent.cpp: (JSC::DFG::VariableEvent::dump): (JSC::DFG::VariableEvent::dumpFillInfo): (JSC::DFG::VariableEvent::dumpSpillInfo): * dfg/DFGVariableEvent.h: (VariableEvent): * disassembler/Disassembler.h: (JSC): (JSC::tryToDisassemble): * disassembler/UDis86Disassembler.cpp: (JSC::tryToDisassemble): Source/WTF: We have a number of places where we pass around a FILE* as a target to which to print some logging information. But the purpose of passing FILE* instead of always assuming that we should dump to stderr is that it may be sometimes useful to send the logging information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome to use it to send logging to a string, for example. We could get around this by using <iostream> and <sstream>, but so far this aspect of C++ has not been part of the WebKit coding conventions. Personally I find <iostream> awkward due to its abuse of operator overloading. So this patch introduces the PrintStream abstract class, which offers printf-like functionality while completely abstracting the destination and mechanism of the printing output. It would be trivial to implement a StringPrintStream, for example. This will feed into work on https://bugs.webkit.org/show_bug.cgi?id=102999. This also sets us up for creating templatized print() and println() methods that will allow us to say things like out.print("count = ", count, "\n"), but that is the topic of https://bugs.webkit.org/show_bug.cgi?id=103009. This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile() now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed to expect a PrintStream&. * GNUmakefile.list.am: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/DataLog.cpp: (WTF): (WTF::initializeLogFileOnce): (WTF::initializeLogFile): (WTF::dataFile): (WTF::dataLogV): (WTF::dataLogString): * wtf/DataLog.h: (WTF): * wtf/FilePrintStream.cpp: Added. (WTF): (WTF::FilePrintStream::FilePrintStream): (WTF::FilePrintStream::~FilePrintStream): (WTF::FilePrintStream::vprintf): (WTF::FilePrintStream::flush): * wtf/FilePrintStream.h: Added. (WTF): (FilePrintStream): (WTF::FilePrintStream::file): * wtf/PrintStream.cpp: Added. (WTF): (WTF::PrintStream::PrintStream): (WTF::PrintStream::~PrintStream): (WTF::PrintStream::printf): (WTF::PrintStream::print): (WTF::PrintStream::println): (WTF::PrintStream::flush): (WTF::print): * wtf/PrintStream.h: Added. (WTF): (PrintStream): (WTF::print): (WTF::println): Canonical link: https://commits.webkit.org/121301@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-24 03:16:47 +00:00
} // namespace WTF