haikuwebkit/Source/WTF/wtf/StringPrintStream.cpp

138 lines
4.4 KiB
C++
Raw Permalink Normal View History

SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
/*
* 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.
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
*/
#include "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/StringPrintStream.h>
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
#include <stdarg.h>
#include <stdio.h>
#include <wtf/FastMalloc.h>
namespace WTF {
StringPrintStream::StringPrintStream()
: m_buffer(m_inlineBuffer)
, m_next(0)
, m_size(sizeof(m_inlineBuffer))
{
m_buffer[0] = 0; // Make sure that we always have a null terminator.
}
StringPrintStream::~StringPrintStream()
{
if (m_buffer == m_inlineBuffer)
return;
fastFree(m_buffer);
}
void StringPrintStream::vprintf(const char* format, va_list argList)
{
Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access https://bugs.webkit.org/show_bug.cgi?id=108981 Reviewed by Eric Seidel. Source/WebCore: * Modules/mediastream/RTCStatsResponse.cpp: (WebCore::RTCStatsResponse::addElement): (WebCore::RTCStatsResponse::addStatistic): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression): (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression): * css/WebKitCSSTransformValue.cpp: (WebCore::transformValueToCssString): * editing/TextIterator.cpp: (WebCore::SearchBuffer::search): * html/HTMLElement.cpp: (WebCore::parseColorStringWithCrazyLegacyRules): * html/ImageData.cpp: (WebCore::ImageData::ImageData): * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::getSomeData): * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): * platform/audio/HRTFDatabase.cpp: (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): * platform/graphics/Region.cpp: (WebCore::Region::Shape::segments_end): * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::getValues): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::inputEffect): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): * platform/text/mac/TextCodecMac.cpp: (WebCore::TextCodecMac::decode): * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::checkFloatsInCleanLine): * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::executeAction): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculatePercentForSpline): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::findInstanceTime): Source/WebKit/chromium: * src/AutofillPopupMenuClient.cpp: (WebKit::AutofillPopupMenuClient::getSuggestion): (WebKit::AutofillPopupMenuClient::getLabel): (WebKit::AutofillPopupMenuClient::getIcon): (WebKit::AutofillPopupMenuClient::removeSuggestionAtIndex): (WebKit::AutofillPopupMenuClient::valueChanged): (WebKit::AutofillPopupMenuClient::selectionChanged): * src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::shouldRunModalDialogDuringPageDismissal): Source/WTF: * wtf/BitVector.h: (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/SegmentedVector.h: (WTF::SegmentedVector::ensureSegment): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::vprintf): * wtf/Vector.h: (WTF::::insert): (WTF::::remove): * wtf/dtoa/utils.h: (WTF::double_conversion::StringBuilder::SetPosition): (WTF::double_conversion::StringBuilder::AddSubstring): Canonical link: https://commits.webkit.org/127675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 08:06:45 +00:00
ASSERT_WITH_SECURITY_IMPLICATION(m_next < m_size);
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
ASSERT(!m_buffer[m_next]);
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
va_list firstPassArgList;
va_copy(firstPassArgList, argList);
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
int numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten =
vsnprintf(m_buffer + m_next, m_size - m_next, format, firstPassArgList);
va_end(firstPassArgList);
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
int numberOfBytesThatWouldHaveBeenWritten =
numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten + 1;
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
if (m_next + numberOfBytesThatWouldHaveBeenWritten <= m_size) {
m_next += numberOfBytesNotIncludingTerminatorThatWouldHaveBeenWritten;
return; // This means that vsnprintf() succeeded.
}
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
increaseSize(m_next + numberOfBytesThatWouldHaveBeenWritten);
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
int numberOfBytesNotIncludingTerminatorThatWereWritten =
vsnprintf(m_buffer + m_next, m_size - m_next, format, argList);
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
int numberOfBytesThatWereWritten = numberOfBytesNotIncludingTerminatorThatWereWritten + 1;
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
ASSERT_UNUSED(numberOfBytesThatWereWritten, m_next + numberOfBytesThatWereWritten <= m_size);
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
m_next += numberOfBytesNotIncludingTerminatorThatWereWritten;
Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access https://bugs.webkit.org/show_bug.cgi?id=108981 Reviewed by Eric Seidel. Source/WebCore: * Modules/mediastream/RTCStatsResponse.cpp: (WebCore::RTCStatsResponse::addElement): (WebCore::RTCStatsResponse::addStatistic): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression): (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression): * css/WebKitCSSTransformValue.cpp: (WebCore::transformValueToCssString): * editing/TextIterator.cpp: (WebCore::SearchBuffer::search): * html/HTMLElement.cpp: (WebCore::parseColorStringWithCrazyLegacyRules): * html/ImageData.cpp: (WebCore::ImageData::ImageData): * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::getSomeData): * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): * platform/audio/HRTFDatabase.cpp: (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): * platform/graphics/Region.cpp: (WebCore::Region::Shape::segments_end): * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::getValues): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::inputEffect): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): * platform/text/mac/TextCodecMac.cpp: (WebCore::TextCodecMac::decode): * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::checkFloatsInCleanLine): * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::executeAction): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculatePercentForSpline): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::findInstanceTime): Source/WebKit/chromium: * src/AutofillPopupMenuClient.cpp: (WebKit::AutofillPopupMenuClient::getSuggestion): (WebKit::AutofillPopupMenuClient::getLabel): (WebKit::AutofillPopupMenuClient::getIcon): (WebKit::AutofillPopupMenuClient::removeSuggestionAtIndex): (WebKit::AutofillPopupMenuClient::valueChanged): (WebKit::AutofillPopupMenuClient::selectionChanged): * src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::shouldRunModalDialogDuringPageDismissal): Source/WTF: * wtf/BitVector.h: (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/SegmentedVector.h: (WTF::SegmentedVector::ensureSegment): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::vprintf): * wtf/Vector.h: (WTF::::insert): (WTF::::remove): * wtf/dtoa/utils.h: (WTF::double_conversion::StringBuilder::SetPosition): (WTF::double_conversion::StringBuilder::AddSubstring): Canonical link: https://commits.webkit.org/127675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 08:06:45 +00:00
ASSERT_WITH_SECURITY_IMPLICATION(m_next < m_size);
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
ASSERT(!m_buffer[m_next]);
}
CString StringPrintStream::toCString()
{
ASSERT(m_next == strlen(m_buffer));
return CString(m_buffer, m_next);
}
JSC should be able to report profiling data associated with the IR dumps and disassembly https://bugs.webkit.org/show_bug.cgi?id=102999 Reviewed by Gavin Barraclough. Source/JavaScriptCore: Added a new profiler to JSC. It's simply called "Profiler" in anticipation of it ultimately replacing the previous profiling infrastructure. This profiler counts the number of times that a bytecode executes in various engines, and will record both the counts and all disassembly and bytecode dumps, into a database that can be at any time turned into either a JS object using any global object or global data of your choice, or can be turned into a JSON string, or saved to a file. Currently the only use of this is the new '-p <file>' flag to the jsc command-line. The profiler is always compiled in and normally incurs no execution time cost, but is only activated when you create a Profiler::Database and install it in JSGlobalData::m_perBytecodeProfiler. From that point on, all code blocks will be compiled along with disassembly and bytecode dumps stored into the Profiler::Database, and all code blocks will have execution counts, which are also stored in the database. The database will continue to keep information about code blocks alive even after they are otherwise GC'd. This currently still has some glitches, like the fact that it only counts executions in the JITs. Doing execution counting in the LLInt might require a bit of a rethink about how the counting is expressed - currently it is implicit in bytecode, so there is no easy way to "turn it on" in the LLInt. Also, right now there is no information recorded about OSR exits or out-of-line stubs. But, even so, it's quite cool, and gives you a peek into what JSC is doing that would otherwise not be possible. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::~CodeBlock): * bytecode/CodeBlock.h: (CodeBlock): (JSC::CodeBlock::baselineVersion): * bytecode/CodeOrigin.cpp: (JSC::InlineCallFrame::baselineCodeBlock): (JSC): * bytecode/CodeOrigin.h: (InlineCallFrame): * dfg/DFGAbstractState.cpp: (JSC::DFG::AbstractState::execute): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGDisassembler.cpp: (JSC::DFG::Disassembler::dump): (DFG): (JSC::DFG::Disassembler::reportToProfiler): (JSC::DFG::Disassembler::dumpHeader): (JSC::DFG::Disassembler::append): (JSC::DFG::Disassembler::createDumpList): * dfg/DFGDisassembler.h: (Disassembler): (JSC::DFG::Disassembler::DumpedOp::DumpedOp): (DumpedOp): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): (JSC::DFG::Graph::dumpCodeOrigin): (JSC::DFG::Graph::dump): * dfg/DFGGraph.h: (Graph): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::JITCompiler): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGNode.h: (Node): (JSC::DFG::Node::hasExecutionCounter): (JSC::DFG::Node::executionCounter): * dfg/DFGNodeType.h: (DFG): * dfg/DFGPredictionPropagationPhase.cpp: (JSC::DFG::PredictionPropagationPhase::propagate): * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compile): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compile): * jit/JIT.cpp: (JSC::JIT::JIT): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompile): * jit/JIT.h: (JIT): * jit/JITDisassembler.cpp: (JSC::JITDisassembler::dump): (JSC::JITDisassembler::reportToProfiler): (JSC): (JSC::JITDisassembler::dumpHeader): (JSC::JITDisassembler::firstSlowLabel): (JSC::JITDisassembler::dumpVectorForInstructions): (JSC::JITDisassembler::dumpForInstructions): (JSC::JITDisassembler::reportInstructions): * jit/JITDisassembler.h: (JITDisassembler): (DumpedOp): * jsc.cpp: (CommandLine::CommandLine): (CommandLine): (printUsageStatement): (CommandLine::parseArguments): (jscmain): * profiler/ProfilerBytecode.cpp: Added. (Profiler): (JSC::Profiler::Bytecode::toJS): * profiler/ProfilerBytecode.h: Added. (Profiler): (Bytecode): (JSC::Profiler::Bytecode::Bytecode): (JSC::Profiler::Bytecode::bytecodeIndex): (JSC::Profiler::Bytecode::description): (JSC::Profiler::getBytecodeIndexForBytecode): * profiler/ProfilerBytecodes.cpp: Added. (Profiler): (JSC::Profiler::Bytecodes::Bytecodes): (JSC::Profiler::Bytecodes::~Bytecodes): (JSC::Profiler::Bytecodes::indexForBytecodeIndex): (JSC::Profiler::Bytecodes::forBytecodeIndex): (JSC::Profiler::Bytecodes::dump): (JSC::Profiler::Bytecodes::toJS): * profiler/ProfilerBytecodes.h: Added. (Profiler): (Bytecodes): (JSC::Profiler::Bytecodes::append): (JSC::Profiler::Bytecodes::id): (JSC::Profiler::Bytecodes::hash): (JSC::Profiler::Bytecodes::size): (JSC::Profiler::Bytecodes::at): * profiler/ProfilerCompilation.cpp: Added. (Profiler): (JSC::Profiler::Compilation::Compilation): (JSC::Profiler::Compilation::~Compilation): (JSC::Profiler::Compilation::addDescription): (JSC::Profiler::Compilation::executionCounterFor): (JSC::Profiler::Compilation::toJS): * profiler/ProfilerCompilation.h: Added. (Profiler): (Compilation): (JSC::Profiler::Compilation::bytecodes): (JSC::Profiler::Compilation::kind): * profiler/ProfilerCompilationKind.cpp: Added. (WTF): (WTF::printInternal): * profiler/ProfilerCompilationKind.h: Added. (Profiler): (WTF): * profiler/ProfilerCompiledBytecode.cpp: Added. (Profiler): (JSC::Profiler::CompiledBytecode::CompiledBytecode): (JSC::Profiler::CompiledBytecode::~CompiledBytecode): (JSC::Profiler::CompiledBytecode::toJS): * profiler/ProfilerCompiledBytecode.h: Added. (Profiler): (CompiledBytecode): (JSC::Profiler::CompiledBytecode::originStack): (JSC::Profiler::CompiledBytecode::description): * profiler/ProfilerDatabase.cpp: Added. (Profiler): (JSC::Profiler::Database::Database): (JSC::Profiler::Database::~Database): (JSC::Profiler::Database::addBytecodes): (JSC::Profiler::Database::ensureBytecodesFor): (JSC::Profiler::Database::notifyDestruction): (JSC::Profiler::Database::newCompilation): (JSC::Profiler::Database::toJS): (JSC::Profiler::Database::toJSON): (JSC::Profiler::Database::save): * profiler/ProfilerDatabase.h: Added. (Profiler): (Database): * profiler/ProfilerExecutionCounter.h: Added. (Profiler): (ExecutionCounter): (JSC::Profiler::ExecutionCounter::ExecutionCounter): (JSC::Profiler::ExecutionCounter::address): (JSC::Profiler::ExecutionCounter::count): * profiler/ProfilerOrigin.cpp: Added. (Profiler): (JSC::Profiler::Origin::Origin): (JSC::Profiler::Origin::dump): (JSC::Profiler::Origin::toJS): * profiler/ProfilerOrigin.h: Added. (JSC): (Profiler): (Origin): (JSC::Profiler::Origin::Origin): (JSC::Profiler::Origin::operator!): (JSC::Profiler::Origin::bytecodes): (JSC::Profiler::Origin::bytecodeIndex): (JSC::Profiler::Origin::operator!=): (JSC::Profiler::Origin::operator==): (JSC::Profiler::Origin::hash): (JSC::Profiler::Origin::isHashTableDeletedValue): (JSC::Profiler::OriginHash::hash): (JSC::Profiler::OriginHash::equal): (OriginHash): (WTF): * profiler/ProfilerOriginStack.cpp: Added. (Profiler): (JSC::Profiler::OriginStack::OriginStack): (JSC::Profiler::OriginStack::~OriginStack): (JSC::Profiler::OriginStack::append): (JSC::Profiler::OriginStack::operator==): (JSC::Profiler::OriginStack::hash): (JSC::Profiler::OriginStack::dump): (JSC::Profiler::OriginStack::toJS): * profiler/ProfilerOriginStack.h: Added. (JSC): (Profiler): (OriginStack): (JSC::Profiler::OriginStack::OriginStack): (JSC::Profiler::OriginStack::operator!): (JSC::Profiler::OriginStack::size): (JSC::Profiler::OriginStack::fromBottom): (JSC::Profiler::OriginStack::fromTop): (JSC::Profiler::OriginStack::isHashTableDeletedValue): (JSC::Profiler::OriginStackHash::hash): (JSC::Profiler::OriginStackHash::equal): (OriginStackHash): (WTF): * runtime/CommonIdentifiers.h: * runtime/ExecutionHarness.h: (JSC::prepareForExecution): (JSC::prepareFunctionForExecution): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::~JSGlobalData): * runtime/JSGlobalData.h: (JSGlobalData): * runtime/Options.h: (JSC): Source/WTF: Made some minor changes to support the new profiler. FileOutputStream now has an open() method, and DataLog uses it. StringPrintStream has a reset() method, which allows you to reuse the same StringPrintStream for creating multiple strings. SegmentedVector now has a const operator[]. And, WTFString now can do fromUTF8() on a CString directly. * wtf/DataLog.cpp: (WTF::initializeLogFileOnce): * wtf/FilePrintStream.cpp: (WTF::FilePrintStream::open): (WTF): * wtf/FilePrintStream.h: * wtf/SegmentedVector.h: (WTF::SegmentedVector::at): (SegmentedVector): (WTF::SegmentedVector::operator[]): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::reset): (WTF): * wtf/StringPrintStream.h: (StringPrintStream): * wtf/text/WTFString.cpp: (WTF::String::fromUTF8): (WTF): * wtf/text/WTFString.h: (String): Tools: Added a tool that allows you to grok the output from JSC's new profiler. Currently, this still gets confused a bit about the execution counts of a method running standalone versus a method running inlined, but other than that, it's pretty cool. See the attached "sampling profiling session" attached to the bug to see it in action. Also had to feed EFL's build system. * DumpRenderTree/efl/CMakeLists.txt: * Scripts/display-profiler-output: Added. Canonical link: https://commits.webkit.org/122183@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-05 01:26:13 +00:00
void StringPrintStream::reset()
{
m_next = 0;
m_buffer[0] = 0;
}
Expected<String, UTF8ConversionError> StringPrintStream::tryToString()
{
ASSERT(m_next == strlen(m_buffer));
if (m_next > String::MaxLength)
return makeUnexpected(UTF8ConversionError::OutOfMemory);
return String::fromUTF8(m_buffer, m_next);
}
String StringPrintStream::toString()
{
ASSERT(m_next == strlen(m_buffer));
return String::fromUTF8(m_buffer, m_next);
}
JS parser incorrectly handles invalid utf8 in error messages. https://bugs.webkit.org/show_bug.cgi?id=158128 Reviewed by Saam Barati. Source/JavaScriptCore: The bug here was caused by us using PrintStream's toString method to produce the error message for a parse error, even though toString may produce a null string in the event of invalid utf8 that causes the error in first case. So when we try to create an error message containing the invalid character code, we set m_errorMessage to the null string, as that signals "no error" we don't stop parsing, and everything goes down hill from there. Now we use the new toStringWithLatin1Fallback so that we can always produce an error message, even if it contains invalid unicode. We also add an additional fallback so that we can guarantee an error message is set even if we're given a null string. There's a debug mode assertion to prevent anyone accidentally attempting to clear the message via setErrorMessage. * parser/Parser.cpp: (JSC::Parser<LexerType>::logError): * parser/Parser.h: (JSC::Parser::setErrorMessage): Source/WTF: Add a new toStringWithLatin1Fallback that simply uses String::fromUTF8WithLatin1Fallback, so we can avoid the standard String::fromUTF8 null return. * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::toStringWithLatin1Fallback): * wtf/StringPrintStream.h: LayoutTests: Add a testcase. * js/invalid-utf8-in-syntax-error-expected.txt: Added. * js/script-tests/invalid-utf8-in-syntax-error.js: Added. Canonical link: https://commits.webkit.org/176410@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-02 23:07:48 +00:00
String StringPrintStream::toStringWithLatin1Fallback()
{
ASSERT(m_next == strlen(m_buffer));
return String::fromUTF8WithLatin1Fallback(m_buffer, m_next);
}
SpeculatedType dumping should not use the static char buffer[thingy] idiom https://bugs.webkit.org/show_bug.cgi?id=103584 Reviewed by Michael Saboff. Source/JavaScriptCore: Changed SpeculatedType to be "dumpable" by saying things like: dataLog("thingy = ", SpeculationDump(thingy)) Removed the old stringification functions, and changed all code that referred to them to use the new dataLog()/print() style. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.xcodeproj/project.pbxproj: * Target.pri: * bytecode/SpeculatedType.cpp: (JSC::dumpSpeculation): (JSC::speculationToAbbreviatedString): (JSC::dumpSpeculationAbbreviated): * bytecode/SpeculatedType.h: * bytecode/ValueProfile.h: (JSC::ValueProfileBase::dump): * bytecode/VirtualRegister.h: (WTF::printInternal): * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::dump): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation): (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dump): (JSC::DFG::Graph::predictArgumentTypes): * dfg/DFGGraph.h: (Graph): * dfg/DFGStructureAbstractValue.h: * dfg/DFGVariableAccessDataDump.cpp: Added. (JSC::DFG::VariableAccessDataDump::VariableAccessDataDump): (JSC::DFG::VariableAccessDataDump::dump): * dfg/DFGVariableAccessDataDump.h: Added. (VariableAccessDataDump): Source/WTF: Added a StringPrintStream, and made it easy to create dumpers for typedefs to primitives. * GNUmakefile.list.am: * WTF.gypi: * WTF.pro: * WTF.vcproj/WTF.vcproj: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/PrintStream.cpp: (WTF::dumpCharacter): * wtf/PrintStream.h: (WTF::printInternal): * wtf/StringPrintStream.cpp: Added. (WTF::StringPrintStream::StringPrintStream): (WTF::StringPrintStream::~StringPrintStream): (WTF::StringPrintStream::vprintf): (WTF::StringPrintStream::toCString): (WTF::StringPrintStream::increaseSize): * wtf/StringPrintStream.h: Added. (StringPrintStream): (WTF::toCString): Canonical link: https://commits.webkit.org/121716@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-29 06:01:40 +00:00
void StringPrintStream::increaseSize(size_t newSize)
{
Replace bounds checking ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION https://bugs.webkit.org/show_bug.cgi?id=120893 Patch by Jessica Pease <jessica_n_pease@apple.com> on 2013-09-06 Reviewed by Darin Adler. Source/WebCore: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPathLexer::lex): * Modules/indexeddb/IDBLevelDBCoding.cpp: (WebCore::IDBLevelDBCoding::compareEncodedIDBKeys): * bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::cssPropertyIDForJSCSSPropertyName): * css/CSSFontSelector.cpp: (WebCore::compareFontFaces): * css/CSSParser.cpp: (WebCore::CSSParser::rewriteSpecifiers): * html/HTMLCollection.cpp: (WebCore::traverseMatchingElementsForwardToOffset): (WebCore::LiveNodeListBase::traverseChildNodeListForwardToOffset): (WebCore::HTMLCollection::traverseForwardToOffset): * html/HTMLFontElement.cpp: (WebCore::parseFontSize): * html/parser/HTMLParserIdioms.cpp: (WebCore::parseHTMLIntegerInternal): (WebCore::parseHTMLNonNegativeIntegerInternal): * inspector/InspectorStyleSheet.h: (WebCore::InspectorStyleProperty::setRawTextFromStyleDeclaration): * platform/graphics/StringTruncator.cpp: (WebCore::centerTruncateToBuffer): (WebCore::rightTruncateToBuffer): (WebCore::truncateString): * platform/graphics/TextRun.h: (WebCore::TextRun::subRun): * platform/text/BidiRunList.h: (WebCore::::reverseRuns): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::selectionRectForTextFragment): (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates): * rendering/svg/SVGTextChunkBuilder.cpp: (WebCore::SVGTextChunkBuilder::buildTextChunks): * rendering/svg/SVGTextLayoutEngine.cpp: (WebCore::SVGTextLayoutEngine::currentLogicalCharacterMetrics): * rendering/svg/SVGTextQuery.cpp: (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGPathByteStreamSource.h: (WebCore::SVGPathByteStreamSource::readType): Source/WebKit2: * Shared/Plugins/PluginQuirks.h: (WebKit::PluginQuirks::add): Source/WTF: * wtf/BumpPointerAllocator.h: (WTF::BumpPointerPool::ensureCapacity): (WTF::BumpPointerPool::alloc): (WTF::BumpPointerPool::ensureCapacityCrossPool): * wtf/FastMalloc.cpp: (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::increaseSize): * wtf/dtoa/utils.h: (WTF::double_conversion::BufferReference::SubBufferReference): * wtf/text/WTFString.cpp: (WTF::String::fromUTF8): Canonical link: https://commits.webkit.org/140810@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-12 18:03:39 +00:00
ASSERT_WITH_SECURITY_IMPLICATION(newSize > m_size);
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
ASSERT(newSize > sizeof(m_inlineBuffer));
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
// Use exponential resizing to reduce thrashing.
m_size = newSize << 1;
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
// Use fastMalloc instead of fastRealloc because we know that for the sizes we're using,
// fastRealloc will just do malloc+free anyway. Also, this simplifies the code since
// we can't realloc the inline buffer.
char* newBuffer = static_cast<char*>(fastMalloc(m_size));
Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a progression. Source/bmalloc: * bmalloc/Algorithm.h: (bmalloc::fastCopy): Deleted. (bmalloc::fastZeroFill): Deleted. * bmalloc/Allocator.cpp: (bmalloc::Allocator::reallocate): * bmalloc/Bits.h: (bmalloc::BitsWordOwner::operator=): (bmalloc::BitsWordOwner::clearAll): (bmalloc::BitsWordOwner::set): * bmalloc/IsoPageInlines.h: (bmalloc::IsoPage<Config>::IsoPage): * bmalloc/Vector.h: (bmalloc::Vector<T>::reallocateBuffer): Source/JavaScriptCore: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::append): * heap/LargeAllocation.cpp: (JSC::LargeAllocation::tryCreate): * heap/MarkedBlock.cpp: (JSC::MarkedBlock::Handle::didAddToDirectory): * runtime/ArrayBuffer.cpp: (JSC::ArrayBufferContents::tryAllocate): (JSC::ArrayBufferContents::copyTo): (JSC::ArrayBuffer::createInternal): * runtime/ArrayBufferView.h: (JSC::ArrayBufferView::zeroRangeImpl): * runtime/ArrayConventions.cpp: (JSC::clearArrayMemset): * runtime/ArrayConventions.h: (JSC::clearArray): * runtime/ArrayPrototype.cpp: (JSC::arrayProtoPrivateFuncConcatMemcpy): * runtime/ButterflyInlines.h: (JSC::Butterfly::tryCreate): (JSC::Butterfly::createOrGrowPropertyStorage): (JSC::Butterfly::growArrayRight): (JSC::Butterfly::resizeArray): * runtime/GenericTypedArrayViewInlines.h: (JSC::GenericTypedArrayView<Adaptor>::create): * runtime/JSArray.cpp: (JSC::JSArray::appendMemcpy): (JSC::JSArray::fastSlice): * runtime/JSArrayBufferView.cpp: (JSC::JSArrayBufferView::ConstructionContext::ConstructionContext): * runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::set): * runtime/JSObject.cpp: (JSC::JSObject::constructConvertedArrayStorageWithoutCopyingElements): (JSC::JSObject::shiftButterflyAfterFlattening): * runtime/PropertyTable.cpp: (JSC::PropertyTable::PropertyTable): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::clearAll): (WTF::BitVector::resizeOutOfLine): * wtf/BitVector.h: (WTF::BitVector::OutOfLineBits::numWords const): (WTF::BitVector::wordCount): Deleted. * wtf/CMakeLists.txt: * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::growExact): * wtf/FastBitVector.h: (WTF::FastBitVectorWordOwner::operator=): (WTF::FastBitVectorWordOwner::clearAll): (WTF::FastBitVectorWordOwner::set): * wtf/FastCopy.h: Removed. * wtf/FastMalloc.cpp: (WTF::fastZeroedMalloc): (WTF::fastStrDup): (WTF::tryFastZeroedMalloc): * wtf/FastZeroFill.h: Removed. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::increaseSize): * wtf/Vector.h: * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::decodeFixedLengthData): * wtf/persistence/PersistentEncoder.cpp: (WTF::Persistence::Encoder::encodeFixedLengthData): * wtf/text/CString.cpp: (WTF::CString::init): (WTF::CString::copyBufferIfNeeded): * wtf/text/LineBreakIteratorPoolICU.h: (WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword): * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::allocateBuffer): (WTF::StringBuilder::append): * wtf/text/StringConcatenate.h: * wtf/text/StringImpl.h: (WTF::StringImpl::copyCharacters): * wtf/text/icu/UTextProvider.cpp: (WTF::uTextCloneImpl): * wtf/text/icu/UTextProviderLatin1.cpp: (WTF::uTextLatin1Clone): (WTF::openLatin1UTextProvider): * wtf/threads/Signals.cpp: Canonical link: https://commits.webkit.org/198639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-16 21:38:53 +00:00
memcpy(newBuffer, m_buffer, m_next + 1);
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
if (m_buffer != m_inlineBuffer)
fastFree(m_buffer);
m_buffer = newBuffer;
}
} // namespace WTF