Reviewed by Eric Seidel.
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 22:59:29 +0000 (22:59 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Nov 2007 22:59:29 +0000 (22:59 +0000)
commit5bcae90d2aca550900bd8cd5cb86188d18602c5d
treec8fcd4358c41f274af85befa4cfae57f351ac642
parent56f1e0339e62a8110583c707bf102ad0f60c589f
    Reviewed by Eric Seidel.

        Cleaned up the JavaScript grammar a bit.

        1. Changed BlockNode to always hold a child vector (which may be empty),
        eliminating a few NULL-check branches in the common execution case.

        2. Changed the Block production to correctly report its starting and
        ending line numbers to the debugger. (It used to report its ending line
        as its starting line.) Also, removed duplicate line-reporting code
        inside the BlockNode constructor.

        3. Moved curly braces up from FunctionBody production into parent
        productions. (I had to move the line number reporting code, too, since
        it depends on the location of the curly braces.) This matches the ECMA
        spec more closely, and makes some future changes I plan easier.

        4. Fixed statementList* convenience functions to deal appropriately with
        empty Vectors.

        SunSpider reports a small and statistically insignificant speedup.

        * kjs/grammar.y:
        * kjs/nodes.cpp:
        (KJS::statementListPushFIFO):
        (KJS::statementListGetDeclarations):
        (KJS::statementListInitializeDeclarationStack):
        (KJS::statementListInitializeVariableAccessStack):
        (KJS::BlockNode::BlockNode):
        (KJS::BlockNode::optimizeVariableAccess):
        (KJS::BlockNode::getDeclarations):
        (KJS::BlockNode::execute):
        (KJS::FunctionBodyNode::initializeDeclarationStacks):
        (KJS::FunctionBodyNode::optimizeVariableAccess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/grammar.y
JavaScriptCore/kjs/nodes.cpp