fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 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"
|
2018-10-15 14:24:49 +00:00
|
|
|
#include <wtf/SixCharacterHash.h>
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
#include <wtf/ASCIICType.h>
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
|
|
|
|
namespace WTF {
|
|
|
|
|
|
|
|
unsigned sixCharacterHashStringToInteger(const char* string)
|
|
|
|
{
|
|
|
|
unsigned hash = 0;
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < 6; ++i) {
|
|
|
|
hash *= 62;
|
|
|
|
unsigned c = string[i];
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
RELEASE_ASSERT(c); // FIXME: Why does this need to be a RELEASE_ASSERT?
|
|
|
|
if (isASCIIUpper(c)) {
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
hash += c - 'A';
|
|
|
|
continue;
|
|
|
|
}
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
if (isASCIILower(c)) {
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
hash += c - 'a' + 26;
|
|
|
|
continue;
|
|
|
|
}
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
ASSERT(isASCIIDigit(c));
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
hash += c - '0' + 26 * 2;
|
|
|
|
}
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
|
2016-12-06 21:03:43 +00:00
|
|
|
RELEASE_ASSERT(!string[6]); // FIXME: Why does this need to be a RELEASE_ASSERT?
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
|
2013-12-10 01:28:05 +00:00
|
|
|
std::array<char, 7> integerToSixCharacterHashString(unsigned hash)
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
{
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
static const char table[63] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
2013-12-10 01:28:05 +00:00
|
|
|
std::array<char, 7> buffer;
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
unsigned accumulator = hash;
|
|
|
|
for (unsigned i = 6; i--;) {
|
Use ASCIICType more, and improve it a little bit
https://bugs.webkit.org/show_bug.cgi?id=165360
Reviewed by Sam Weinig.
Source/JavaScriptCore:
* inspector/InspectorValues.cpp:
(Inspector::readHexDigits): Use isASCIIHexDigit.
(Inspector::hextoInt): Deleted.
(decodeString): Use toASCIIHexValue.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseDigit): Use isASCIIDigit, isASCIIUpper, and isASCIILower.
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow): Use isASCIIDigit.
Source/WebCore:
* css/CSSGrammar.y.in: Use isASCIIDigit.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontFaceUnicodeRange): Use isASCIIHexDigit and
toASCIIHexValue.
(WebCore::isEqualToCSSIdentifier): Use isASCIILower.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): Use isASCIILower.
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::tokenize): Use isASCIIAlpha.
* platform/Decimal.cpp:
(WebCore::Decimal::fromString): Use isASCIIDigit.
* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Use isASCIIHexDigit and toASCIIHexValue.
* platform/URL.cpp:
(WebCore::isLetterMatchIgnoringCase): Deleted.
(WebCore::isSchemeCharacterMatchIgnoringCase): Deleted.
(WebCore::assertProtocolIsGood): Use isASCIIUpper.
(WebCore::URL::protocolIs): Use isASCIIAlphaCaselessEqual.
(WebCore::URL::parse): Ditto.
(WebCore::protocolIs): Ditto.
(WebCore::protocolIsInHTTPFamily): Ditto.
* platform/URLParser.cpp:
(WeCore::URLParser::parseIPv4Piece): Use isASCIIDigit.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isRussianDomainNameCharacter): Use isASCIIDigit.
(WebCore::allCharactersAllowedByTLDRules): Ditto.
(WebCore::dataWithUserTypedString): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
(WebCore::dataForURLComponentType): Ditto.
(WebCore::createStringWithEscapedUnsafeCharacters): Ditto.
(WebCore::userVisibleString): Use isASCIIHexDigit, toASCIIHexValue,
upperNibbleToASCIIHexDigit, and lowerNibbleToASCIIHexDigit.
(WebCore::isUserVisibleURL): Use isASCIIHexDigit and toASCIIHexValue.
* platform/network/FormDataBuilder.cpp:
(WebCore::FormDataBuilder::encodeStringAsFormData): Use isASCIIAlphanumeric.
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::mathVariant): Use isASCIIUpper, isASCIILower, and isASCIIDigit.
* svg/SVGParserUtilities.cpp:
(WebCore::genericParseNumber): Use isASCIIDigit.
* svg/SVGPathStringSource.cpp:
(WebCore::nextCommandHelper): Ditto.
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::lexNumber): Ditto.
(WebCore::XPath::Parser::nextTokenInternal): Ditto.
Source/WebKit2:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
Source/WTF:
* wtf/ASCIICType.h: Added declarations of all the functions to the top of the file,
so we have a list of what's available, not just a mix of that and the implementation.
* wtf/HexNumber.h:
(WTF::Internal::hexDigitsForMode): Moved lowerHexDigits and upperHexDigits
inside this function.
(WTF::appendByteAsHex): Use auto.
(WTF::placeByteAsHexCompressIfPossible): Ditto.
(WTF::placeByteAsHex): Ditto.
(WTF::appendUnsignedAsHex): Ditto.
(WTF::appendUnsigned64AsHex): Ditto.
(WTF::appendUnsignedAsHexFixedSize): Ditto.
(WTF::isHexDigit): Deleted.
(WTF::uncheckedHexDigit): Deleted.
(WTF::hexDigitValue): Deleted.
(WTF::uncheckedHexDigitValue): Deleted.
* wtf/SixCharacterHash.cpp:
(WTF::sixCharacterHashStringToInteger): Use isASCIIUpper, isASCIILower, and
isASCIIDigit. Also added some FIXMEs; for some reason this function uses
RELEASE_ASSERT to abort if the passed-in string is not six characters long,
and it's not clear to me why this is so critical to assert.
(WTF::integerToSixCharacterHashString): Moved the table inside this function,
obviating the need for a macro named TABLE.
* wtf/dtoa/bignum.cc:
(WTF::double_conversion::HexCharValue): Deleted.
(WTF::double_conversion::Bignum::AssignHexString): Use toASCIIHexValue.
* wtf/dtoa/double-conversion.cc:
(WTF::double_conversion::StringToDoubleConverter::StringToDouble): Use isASCIIDigit.
* wtf/text/StringBuilder.cpp:
(WTF::appendQuotedJSONStringInternal): Use upperNibbleToASCIIHexDigit and
lowerNibbleToASCIIHexDigit.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToUppercaseWithoutLocale): Use toASCIIUpper.
Removed the workaround for a bug that was fixed in Visual Studio 2013.
Canonical link: https://commits.webkit.org/183066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-12-06 17:18:20 +00:00
|
|
|
buffer[i] = table[accumulator % 62];
|
fourthTier: DFG IR dumps should be easier to read
https://bugs.webkit.org/show_bug.cgi?id=119050
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg.
Added a DumpContext that includes support for printing an endnote
that describes all structures in full, while the main flow of the
dump just uses made-up names for the structures. This is helpful
since Structure::dump() may print a lot. The stuff it prints is
useful, but if it's all inline with the surrounding thing you're
dumping (often, a node in the DFG), then you get a ridiculously
long print-out. All classes that dump structures (including
Structure itself) now have dumpInContext() methods that use
inContext() for dumping anything that might transitively print a
structure. If Structure::dumpInContext() is called with a NULL
context, it just uses dump() like before. Hence you don't have to
know anything about DumpContext unless you want to.
inContext(*structure, context) dumps something like %B4:Array,
and the endnote will have something like:
%B4:Array = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
where B4 is the inferred name that StringHashDumpContext came up
with.
Also shortened a bunch of other dumps, removing information that
isn't so important.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/ArrayProfile.cpp:
(JSC::dumpArrayModes):
* bytecode/CodeBlockHash.cpp:
(JSC):
(JSC::CodeBlockHash::CodeBlockHash):
(JSC::CodeBlockHash::dump):
* bytecode/CodeOrigin.cpp:
(JSC::CodeOrigin::dumpInContext):
(JSC):
(JSC::InlineCallFrame::dumpInContext):
(JSC::InlineCallFrame::dump):
* bytecode/CodeOrigin.h:
(CodeOrigin):
(InlineCallFrame):
* bytecode/Operands.h:
(JSC::OperandValueTraits::isEmptyForDump):
(Operands):
(JSC::Operands::dump):
(JSC):
* bytecode/OperandsInlines.h: Added.
(JSC):
(JSC::::dumpInContext):
* bytecode/StructureSet.h:
(JSC::StructureSet::dumpInContext):
(JSC::StructureSet::dump):
(StructureSet):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::dump):
(DFG):
(JSC::DFG::AbstractValue::dumpInContext):
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::operator!):
(AbstractValue):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
(JSC::DFG::NodePointerTraits::isEmptyForDump):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::createDumpList):
* dfg/DFGDisassembler.h:
(Disassembler):
* dfg/DFGFlushFormat.h:
(WTF::inContext):
(WTF):
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dumpCodeOrigin):
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGGraph.h:
(Graph):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::dumpInContext):
(JSC::DFG::LazyJSValue::dump):
(DFG):
* dfg/DFGLazyJSValue.h:
(LazyJSValue):
* dfg/DFGNode.h:
(JSC::DFG::nodeMapDump):
(WTF::inContext):
(WTF):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::dumpInContext):
(JSC::DFG::StructureAbstractValue::dump):
(StructureAbstractValue):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
(JSC::FTL::ExitValue::dump):
(FTL):
* ftl/FTLExitValue.h:
(ExitValue):
* ftl/FTLLowerDFGToLLVM.cpp:
* ftl/FTLValueSource.cpp:
(JSC::FTL::ValueSource::dumpInContext):
(FTL):
* ftl/FTLValueSource.h:
(ValueSource):
* runtime/DumpContext.cpp: Added.
(JSC):
(JSC::DumpContext::DumpContext):
(JSC::DumpContext::~DumpContext):
(JSC::DumpContext::isEmpty):
(JSC::DumpContext::dump):
* runtime/DumpContext.h: Added.
(JSC):
(DumpContext):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dump):
(JSC):
(JSC::JSValue::dumpInContext):
* runtime/JSCJSValue.h:
(JSC):
(JSValue):
* runtime/Structure.cpp:
(JSC::Structure::dumpInContext):
(JSC):
(JSC::Structure::dumpBrief):
(JSC::Structure::dumpContextHeader):
* runtime/Structure.h:
(JSC):
(Structure):
Source/WTF:
Reviewed by Mark Hahnenberg.
Added support for dumping values within a context. By default, if you say
print(inContext(value, context)) it calls value.dumpInContext(out, context)
instead of value.dump(out).
Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
WTF, in the form of SixCharacterHash.h.
Added a helper for creating dump contexts where the inContext() dump will
just use a short string hash to "name" the object being dumped, and then
will print out the full dumps in an endnote to your dump.
Added support for using CString as a hashtable key.
* WTF.xcodeproj/project.pbxproj:
* wtf/PrintStream.h:
(WTF):
(ValueInContext):
(WTF::ValueInContext::ValueInContext):
(WTF::ValueInContext::dump):
(WTF::inContext):
* wtf/SixCharacterHash.cpp: Added.
(WTF):
(WTF::sixCharacterHashStringToInteger):
(WTF::integerToSixCharacterHashString):
* wtf/SixCharacterHash.h: Added.
(WTF):
* wtf/StringHashDumpContext.h: Added.
(WTF):
(StringHashDumpContext):
(WTF::StringHashDumpContext::StringHashDumpContext):
(WTF::StringHashDumpContext::getID):
(WTF::StringHashDumpContext::dumpBrief):
(WTF::StringHashDumpContext::brief):
(WTF::StringHashDumpContext::isEmpty):
(WTF::StringHashDumpContext::dump):
* wtf/text/CString.cpp:
(WTF::CString::hash):
(WTF):
(WTF::operator<):
(WTF::CStringHash::equal):
* wtf/text/CString.h:
(WTF::CString::CString):
(CString):
(WTF::CString::isHashTableDeletedValue):
(WTF):
(WTF::CStringHash::hash):
(CStringHash):
Canonical link: https://commits.webkit.org/137080@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-07-25 04:05:36 +00:00
|
|
|
accumulator /= 62;
|
|
|
|
}
|
|
|
|
buffer[6] = 0;
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace WTF
|
|
|
|
|