Changeset 60702 in webkit


Ignore:
Timestamp:
Jun 4, 2010 12:54:33 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

Fix the rest of the RECONSUME_IN cases that were missed by our script.
Also, reorder some assigment to prepare for the ADVANCE_TO patch.

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

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60701 r60702  
     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        Fix the rest of the RECONSUME_IN cases that were missed by our script.
     9        Also, reorder some assigment to prepare for the ADVANCE_TO patch.
     10
     11        * html/HTML5Lexer.cpp:
     12        (WebCore::HTML5Lexer::nextToken):
     13
    1142010-06-04  Adam Barth  <abarth@webkit.org>
    215
  • trunk/WebCore/html/HTML5Lexer.cpp

    r60701 r60702  
    452452            } else if (cc == '?') {
    453453                emitParseError();
    454                 m_state = BogusCommentState;
    455454                // The spec consumes the current character before switching
    456455                // to the bogus comment state, but it's easier to implement
    457456                // if we reconsume the current character.
    458                 continue;
    459             } else {
    460                 emitParseError();
    461                 m_state = DataState;
     457                RECONSUME_IN(BogusCommentState);
     458            } else {
     459                emitParseError();
    462460                emitCharacter('<');
    463                 continue;
     461                RECONSUME_IN(DataState);
    464462            }
    465463            break;
     
    10291027                m_state = AfterAttributeValueQuotedState;
    10301028            else if (cc == '&') {
     1029                m_additionalAllowedCharacter = '"';
    10311030                m_state = CharacterReferenceInAttributeValueState;
    1032                 m_additionalAllowedCharacter = '"';
    10331031            } else
    10341032                m_token->appendToAttributeValue(cc);
     
    10421040                m_state = AfterAttributeValueQuotedState;
    10431041            else if (cc == '&') {
     1042                m_additionalAllowedCharacter = '\'';
    10441043                m_state = CharacterReferenceInAttributeValueState;
    1045                 m_additionalAllowedCharacter = '\'';
    10461044            } else
    10471045                m_token->appendToAttributeValue(cc);
     
    10551053                m_state = BeforeAttributeNameState;
    10561054            else if (cc == '&') {
     1055                m_additionalAllowedCharacter = '>';
    10571056                m_state = CharacterReferenceInAttributeValueState;
    1058                 m_additionalAllowedCharacter = '>';
    10591057            } else if (cc == '>') {
    10601058                EMIT_AND_RESUME_IN(DataState);
     
    10871085            // state can be determined by m_additionalAllowedCharacter.
    10881086            if (m_additionalAllowedCharacter == '"')
    1089                 m_state = AttributeValueDoubleQuotedState;
     1087                RECONSUME_IN(AttributeValueDoubleQuotedState)
    10901088            else if (m_additionalAllowedCharacter == '\'')
    1091                 m_state = AttributeValueSingleQuotedState;
     1089                RECONSUME_IN(AttributeValueSingleQuotedState)
    10921090            else if (m_additionalAllowedCharacter == '>')
    1093                 m_state = AttributeValueUnquotedState;
     1091                RECONSUME_IN(AttributeValueUnquotedState)
    10941092            else
    10951093                ASSERT_NOT_REACHED();
    1096             continue;
     1094            break;
    10971095        }
    10981096        END_STATE()
Note: See TracChangeset for help on using the changeset viewer.