2011-05-24 Oliver Hunt <oliver@apple.com>
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2011 18:49:18 +0000 (18:49 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 May 2011 18:49:18 +0000 (18:49 +0000)
commitf88a675a32ab9329af86890af9670e3ef301103d
tree38171a01a679a07fd108e7e3c5fe2b30df6e27c9
parent5ec8ad1c56aa8cb1a3b292aa5751edc9671cb6ed
2011-05-24  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoffrey Garen.

        Avoid creating unnecessary identifiers and strings in the syntax checker
        https://bugs.webkit.org/show_bug.cgi?id=61378

        Selectively tell the lexer that there are some places it does not need to
        do the real work of creating Identifiers for IDENT and STRING tokens.

        Make parseString and parseIdentifier templatized on whether they should
        do real work, or merely validate the tokens.

        SunSpider --parse-only reports ~5-8% win depending on hardware.

        * parser/ASTBuilder.h:
        (JSC::ASTBuilder::createDotAccess):
        * parser/JSParser.cpp:
        (JSC::JSParser::next):
        (JSC::JSParser::consume):
        (JSC::JSParser::parseVarDeclarationList):
        (JSC::JSParser::parseConstDeclarationList):
        (JSC::JSParser::parseExpression):
        (JSC::JSParser::parseAssignmentExpression):
        (JSC::JSParser::parseConditionalExpression):
        (JSC::JSParser::parseBinaryExpression):
        (JSC::JSParser::parseProperty):
        (JSC::JSParser::parseObjectLiteral):
        (JSC::JSParser::parseArrayLiteral):
        (JSC::JSParser::parseArguments):
        (JSC::JSParser::parseMemberExpression):
        * parser/Lexer.cpp:
        (JSC::Lexer::parseIdentifier):
        (JSC::Lexer::parseString):
        (JSC::Lexer::lex):
        * parser/Lexer.h:
        * parser/SyntaxChecker.h:
        (JSC::SyntaxChecker::createDotAccess):
        (JSC::SyntaxChecker::createProperty):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/ASTBuilder.h
Source/JavaScriptCore/parser/JSParser.cpp
Source/JavaScriptCore/parser/Lexer.cpp
Source/JavaScriptCore/parser/Lexer.h
Source/JavaScriptCore/parser/SyntaxChecker.h