-
benjamin@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=83968 Source/JavaScriptCore: Reviewed by Sam Weinig. Add support for the new StringImpl::find() to UString. Change stringProtoFuncIndexOf() to specifically take advatage of the feature. This gives a 12% gains on a distribution of strings between 30 and 100 characters. * runtime/StringPrototype.cpp: (JSC::substituteBackreferences): (JSC::stringProtoFuncIndexOf): * runtime/UString.h: (UString): (JSC::UString::find): Source/WebCore: Reviewed by Sam Weinig. Remove the zero offset of the find() functions on strings. * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::init): * platform/network/ResourceResponseBase.cpp: (WebCore::trimToNextSeparator): (WebCore::parseCacheHeader): Source/WebKit2: Update the symbols files. * win/WebKit2.def: * win/WebKit2CFLite.def: Source/WTF: Reviewed by Sam Weinig. This patch add a version of StringImpl::find() without offset, Instead of using the default value for the index. By not having the index, we can skip a couple of branches and a few instructions. This gives significant gains when the strings are short-ish. The case of empty string is moved below (matchLength == 1) since it is a less common operation. * wtf/text/StringImpl.cpp: (WTF::StringImpl::find): (WTF): * wtf/text/StringImpl.h: (StringImpl): * wtf/text/WTFString.h: (String): (WTF::String::find): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
c363c518