Ignore:
Timestamp:
Apr 15, 2022, 9:44:41 PM (3 years ago)
Author:
Chris Dumez
Message:

Leverage StringView in more places to avoid some String allocations
https://bugs.webkit.org/show_bug.cgi?id=239356

Reviewed by Darin Adler.

Source/JavaScriptCore:

  • inspector/ContentSearchUtilities.cpp:

(Inspector::ContentSearchUtilities::getRegularExpressionMatchesByLines):
(Inspector::ContentSearchUtilities::findMagicComment):

  • runtime/ExceptionHelpers.cpp:

(JSC::invalidParameterInSourceAppender):
(JSC::invalidParameterInstanceofSourceAppender):

  • runtime/IntlDateTimeFormat.cpp:

(JSC::IntlDateTimeFormat::formatToParts const):
(JSC::IntlDateTimeFormat::formatRangeToParts):

  • runtime/IntlListFormat.cpp:

(JSC::IntlListFormat::formatToParts const):

  • runtime/IntlNumberFormat.cpp:

(JSC::IntlNumberFormat::formatRangeToPartsInternal):

  • tools/FunctionOverrides.cpp:

(JSC::initializeOverrideInfo):

Source/WebCore:

  • Modules/fetch/FetchBodyConsumer.cpp:

(WebCore::FetchBodyConsumer::packageFormData):

  • Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:

(WebCore::toRtpCodecCapability):

  • Modules/model-element/scenekit/SceneKitModelLoader.mm:

(WebCore::mimeTypeUtilizingFileExtensionOverridingForLocalFiles):

  • Modules/plugins/PluginReplacement.h:

(WebCore::ReplacementPlugin::supportsFileExtension const):

  • Modules/plugins/YouTubePluginReplacement.cpp:

(WebCore::YouTubePluginReplacement::supportsFileExtension):

  • Modules/plugins/YouTubePluginReplacement.h:
  • animation/KeyframeEffect.cpp:

(WebCore::KeyframeEffect::setPseudoElement):

  • css/ContainerQueryParser.cpp:

(WebCore::ContainerQueryParser::consumePlainSizeFeature):

  • css/parser/CSSSelectorParser.cpp:

(WebCore::consumeANPlusB):

  • dom/SecurityContext.cpp:

(WebCore::SecurityContext::parseSandboxPolicy):

  • dom/SecurityContext.h:
  • fileapi/ThreadableBlobRegistry.cpp:

(WebCore::isBlobURLContainsNullOrigin):

  • html/DOMTokenList.cpp:

(WebCore::DOMTokenList::updateTokensFromAttributeValue):

  • html/DOMTokenList.h:
  • html/HTMLMapElement.cpp:

(WebCore::HTMLMapElement::parseAttribute):

  • html/HTMLPlugInElement.cpp:

(WebCore::pluginReplacementForType):

  • html/track/WebVTTParser.cpp:

(WebCore::WebVTTParser::checkAndCreateRegion):
(WebCore::WebVTTParser::checkAndStoreRegion):
(WebCore::WebVTTParser::checkStyleSheet):
(WebCore::WebVTTParser::checkAndStoreStyleSheet):

  • html/track/WebVTTParser.h:
  • inspector/InspectorStyleSheet.cpp:

(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):

  • layout/formattingContexts/inline/InlineLineBuilder.cpp:

(WebCore::Layout::toString):

  • layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):

  • layout/layouttree/LayoutInlineTextBox.h:

(WebCore::Layout::InlineTextBox::content const):

  • loader/appcache/ApplicationCacheStorage.cpp:

(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):

  • loader/appcache/ApplicationCacheStorage.h:
  • loader/cache/CachedSVGFont.cpp:

(WebCore::CachedSVGFont::getSVGFontById const):
(WebCore::CachedSVGFont::maybeInitializeExternalSVGFontElement):

  • loader/cache/CachedSVGFont.h:
  • page/Location.cpp:

(WebCore::Location::setHash):

  • page/Page.cpp:

(WebCore::Page::userStyleSheetLocationChanged):

  • page/UserContentURLPattern.cpp:

(WebCore::UserContentURLPattern::parse):

  • page/UserContentURLPattern.h:

(WebCore::UserContentURLPattern::UserContentURLPattern):

  • platform/MIMETypeRegistry.cpp:

(WebCore::typesForCommonExtension):
(WebCore::MIMETypeRegistry::mediaMIMETypeForExtension):

  • platform/MIMETypeRegistry.h:
  • platform/cocoa/DragImageCocoa.mm:

(WebCore::createDragImageIconForCachedImageFilename):

  • platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::load):

  • platform/graphics/angle/GraphicsContextGLANGLE.cpp:

(WebCore::GraphicsContextGLANGLE::getUnmangledInfoLog):

  • platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:

(WebCore::InbandTextTrackPrivateAVF::processCueAttributes):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:

(WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog):

  • platform/network/HTTPParsers.cpp:

(WebCore::parseStructuredFieldValue):
(WebCore::parseRange):

  • platform/network/HTTPParsers.h:
  • platform/network/MIMEHeader.cpp:

(WebCore::retrieveKeyValuePairs):

  • platform/network/ParsedContentType.cpp:

(WebCore::ParsedContentType::setContentType):

  • platform/network/ParsedContentType.h:
  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::textRun const):

Source/WebKit:

  • Platform/cocoa/ImageAnalysisUtilities.mm:

(WebKit::makeTextRecognitionResult):

  • UIProcess/Cocoa/MediaPermissionUtilities.mm:

(WebKit::visibleDomain):

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::performJavaScriptURLRequest):

Source/WebKitLegacy/mac:

  • Misc/WebUserContentURLPattern.mm:

(-[WebUserContentURLPattern initWithPatternString:]):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/tools/FunctionOverrides.cpp

    r292879 r292939  
    134134    unsigned origBraceStart = origProviderStr.find('{', origStart);
    135135    unsigned headerLength = origBraceStart - origFunctionStart;
    136     String origHeader = origProviderStr.substring(origFunctionStart, headerLength);
    137 
    138     String newProviderString = makeString(origHeader, newBody);
     136    auto origHeaderView = StringView(origProviderStr).substring(origFunctionStart, headerLength);
     137
     138    String newProviderString = makeString(origHeaderView, newBody);
    139139
    140140    auto overridden = "<overridden>"_s;
Note: See TracChangeset for help on using the changeset viewer.