Changeset 60701 in webkit


Ignore:
Timestamp:
Jun 4, 2010 12:44:26 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-06-04 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Make HTML5Lexer go fast
https://bugs.webkit.org/show_bug.cgi?id=40048

This patch handles the FLUSH_AND_ADVANCE_TO case. Again, this patch
introduces style errors that will be fixed shortly.

  • html/HTML5Lexer.cpp: (WebCore::HTML5Lexer::nextToken):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60699 r60701  
     12010-06-04  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Make HTML5Lexer go fast
     6        https://bugs.webkit.org/show_bug.cgi?id=40048
     7
     8        This patch handles the FLUSH_AND_ADVANCE_TO case.  Again, this patch
     9        introduces style errors that will be fixed shortly.
     10
     11        * html/HTML5Lexer.cpp:
     12        (WebCore::HTML5Lexer::nextToken):
     13
    1142010-06-04  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebCore/html/HTML5Lexer.cpp

    r60699 r60701  
    343343    }
    344344
     345// When we move away from using a jump table, these macros will be different.
     346#define FLUSH_AND_ADVANCE_TO(stateName) FLUSH_EMIT_AND_RESUME_IN(stateName)
     347
    345348bool HTML5Lexer::nextToken(SegmentedString& source, HTML5Token& token)
    346349{
     
    540543                if (cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' ') {
    541544                    if (isAppropriateEndTag()) {
    542                         m_state = BeforeAttributeNameState;
    543                         maybeFlushBufferedEndTag();
    544                         break;
     545                        FLUSH_AND_ADVANCE_TO(BeforeAttributeNameState);
    545546                    }
    546547                } else if (cc == '/') {
    547548                    if (isAppropriateEndTag()) {
    548                         m_state = SelfClosingStartTagState;
    549                         maybeFlushBufferedEndTag();
    550                         break;
     549                        FLUSH_AND_ADVANCE_TO(SelfClosingStartTagState);
    551550                    }
    552551                } else if (cc == '>') {
     
    606605                if (cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' ') {
    607606                    if (isAppropriateEndTag()) {
    608                         m_state = BeforeAttributeNameState;
    609                         maybeFlushBufferedEndTag();
    610                         break;
     607                        FLUSH_AND_ADVANCE_TO(BeforeAttributeNameState);
    611608                    }
    612609                } else if (cc == '/') {
    613610                    if (isAppropriateEndTag()) {
    614                         m_state = SelfClosingStartTagState;
    615                         maybeFlushBufferedEndTag();
    616                         break;
     611                        FLUSH_AND_ADVANCE_TO(SelfClosingStartTagState);
    617612                    }
    618613                } else if (cc == '>') {
     
    676671                if (cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' ') {
    677672                    if (isAppropriateEndTag()) {
    678                         m_state = BeforeAttributeNameState;
    679                         maybeFlushBufferedEndTag();
    680                         break;
     673                        FLUSH_AND_ADVANCE_TO(BeforeAttributeNameState);
    681674                    }
    682675                } else if (cc == '/') {
    683676                    if (isAppropriateEndTag()) {
    684                         m_state = SelfClosingStartTagState;
    685                         maybeFlushBufferedEndTag();
    686                         break;
     677                        FLUSH_AND_ADVANCE_TO(SelfClosingStartTagState);
    687678                    }
    688679                } else if (cc == '>') {
     
    821812                if (cc == '\x09' || cc == '\x0A' || cc == '\x0C' || cc == ' ') {
    822813                    if (isAppropriateEndTag()) {
    823                         m_state = BeforeAttributeNameState;
    824                         maybeFlushBufferedEndTag();
    825                         break;
     814                        FLUSH_AND_ADVANCE_TO(BeforeAttributeNameState);
    826815                    }
    827816                } else if (cc == '/') {
    828817                    if (isAppropriateEndTag()) {
    829                         m_state = SelfClosingStartTagState;
    830                         maybeFlushBufferedEndTag();
    831                         break;
     818                        FLUSH_AND_ADVANCE_TO(SelfClosingStartTagState);
    832819                    }
    833820                } else if (cc == '>') {
Note: See TracChangeset for help on using the changeset viewer.