Reviewed by Mitz.
- http://bugs.webkit.org/show_bug.cgi?id=15944 streamline SegmentedString to speed up parsing I measured a speed-up of the page load test while developing this patch. I don't have a precise figure, though. * html/HTMLTokenizer.h: Removed unneeded lineNumberPtr() function. Also renamed lineno to m_lineNumber. * html/HTMLTokenizer.cpp: (WebCore::HTMLTokenizer::processListing): Don't pass 0 to the advance function since we don't want to update a line number. (WebCore::HTMLTokenizer::parseSpecial): Ditto. (WebCore::HTMLTokenizer::parseComment): Pass the line number data member directly instead of lineNumberPtr() since the advance function now takes a reference. (WebCore::HTMLTokenizer::parseServer): Ditto. (WebCore::HTMLTokenizer::parseProcessingInstruction): Ditto. (WebCore::HTMLTokenizer::parseText): Ditto. (WebCore::HTMLTokenizer::parseEntity): Ditto. (WebCore::HTMLTokenizer::parseTag): Ditto. (WebCore::HTMLTokenizer::write): Ditto. * loader/FTPDirectoryDocument.cpp: (WebCore::FTPDirectoryTokenizer::write): * loader/TextDocument.cpp: (WebCore::TextTokenizer::write): Don't pass 0 to the advance function. * platform/SegmentedString.h: (WebCore::SegmentedString::advance): Streamlined the most common case, and pushed less common cases into a separate function that is not inlined. Also got rid of a branch by separating the case with a line number from the case without one. * platform/SegmentedString.cpp: (WebCore::SegmentedString::advanceSlowCase): Added. The aforementioned less common cases are here. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Showing with 144 additions and 79 deletions