[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 11:26:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 58e6872ea9f77bb5ab871a8e59e09eb0fbb82acd
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 23 17:47:54 2010 +0000

    2010-07-23  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Add fast-reject path for InputStreamPreprocessor::peek
            https://bugs.webkit.org/show_bug.cgi?id=42881
    
            This is about a 2.5% speedup on the parsing benchmark.
    
            * html/HTMLTokenizer.h:
            (WebCore::HTMLTokenizer::InputStreamPreprocessor::peek):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63987 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 11e102b..a92dc73 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-23  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add fast-reject path for InputStreamPreprocessor::peek
+        https://bugs.webkit.org/show_bug.cgi?id=42881
+
+        This is about a 2.5% speedup on the parsing benchmark.
+
+        * html/HTMLTokenizer.h:
+        (WebCore::HTMLTokenizer::InputStreamPreprocessor::peek):
+
 2010-07-23  Patrick Gansterer  <paroga at paroga.com>
 
         Reviewed by Adam Roben.
diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/HTMLTokenizer.h
index 6778af4..7ee9d41 100644
--- a/WebCore/html/HTMLTokenizer.h
+++ b/WebCore/html/HTMLTokenizer.h
@@ -152,6 +152,17 @@ private:
         ALWAYS_INLINE bool peek(SegmentedString& source, int& lineNumber)
         {
             m_nextInputCharacter = *source;
+
+            // Every branch in this function is expensive, so we have a
+            // fast-reject branch for characters that don't require special
+            // handling.  Please run the parser benchmark whenever you touch
+            // this function.  It's very hot.
+            static const UChar specialCharacterMask = '\n' | '\r' | '\0';
+            if (m_nextInputCharacter & ~specialCharacterMask) {
+                m_skipNextNewLine = false;
+                return true;
+            }
+
             if (m_nextInputCharacter == '\n' && m_skipNextNewLine) {
                 m_skipNextNewLine = false;
                 source.advancePastNewline(lineNumber);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list