Improve performance by using StringView, not "const StringView&"
https://bugs.webkit.org/show_bug.cgi?id=229834
Reviewed by Anders Carlsson.
Source/JavaScriptCore:
- parser/Lexer.h:
- runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::setFormatsFromPattern):
- runtime/IntlDateTimeFormat.h:
Use StringView, not const StringView&.
Source/WebCore:
- html/BaseDateAndTimeInputType.h:
- html/DateInputType.cpp:
(WebCore::DateInputType::parseToDateComponents const):
- html/DateInputType.h:
- html/DateTimeLocalInputType.cpp:
(WebCore::DateTimeLocalInputType::parseToDateComponents const):
- html/DateTimeLocalInputType.h:
- html/MonthInputType.cpp:
(WebCore::MonthInputType::parseToDateComponents const):
- html/MonthInputType.h:
- html/TimeInputType.cpp:
(WebCore::TimeInputType::parseToDateComponents const):
- html/TimeInputType.h:
- html/WeekInputType.cpp:
(WebCore::WeekInputType::parseToDateComponents const):
- html/WeekInputType.h:
- html/parser/HTMLParserIdioms.cpp:
(WebCore::parseMetaHTTPEquivRefresh):
- html/parser/HTMLParserIdioms.h:
- html/parser/HTMLSrcsetParser.h:
- layout/formattingContexts/inline/InlineTextItem.cpp:
(WebCore::Layout::moveToNextNonWhitespacePosition):
- layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::canUseSimplifiedTextMeasuring):
- mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::parseNumberAndUnit):
(WebCore::MathMLPresentationElement::parseNamedSpace):
- mathml/MathMLPresentationElement.h:
- page/Quirks.cpp:
(WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
- platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::expansionOpportunityCount):
(WebCore::FontCascade::leftExpansionOpportunity):
(WebCore::FontCascade::rightExpansionOpportunity):
- platform/graphics/FontCascade.h:
- platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::conformFragmentIdentifierForURL):
- rendering/LegacyLineLayout.cpp:
(WebCore::LegacyLineLayout::computeInlineDirectionPositionsForSegment):
- svg/SVGParserUtilities.cpp:
(WebCore::parseNumber):
(WebCore::parseNumberOptionalNumber):
(WebCore::parsePoint):
(WebCore::parseRect):
(WebCore::parseGlyphName):
(WebCore::parseKerningUnicodeString):
- svg/SVGParserUtilities.h:
Use StringView, not const StringView&.
Source/WTF:
Since StringView is a small structure that fits into two registers, it's not
good to pass a pointer to it; better performance to pass it by value. Note
that this is for release builds, not debug builds where StringView has
significant additional overhead when copying.
(WTF::printInternal):
- wtf/PrintStream.h:
- wtf/text/StringConcatenate.h:
- wtf/text/StringView.cpp:
(WTF::StringView::containsIgnoringASCIICase const):
(WTF::StringView::findIgnoringASCIICase const):
(WTF::StringView::startsWith const):
(WTF::StringView::startsWithIgnoringASCIICase const):
(WTF::StringView::endsWith const):
(WTF::StringView::endsWithIgnoringASCIICase const):
(WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
(WTF::StringView::GraphemeClusters::Iterator::Iterator):
- wtf/text/StringView.h:
- wtf/text/WTFString.h:
Use StringView, not const StringView&.