JavaScriptCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 07:09:44 +0000 (07:09 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 07:09:44 +0000 (07:09 +0000)
commit1a4d0456060fce2271fde0960bef8a577279f80c
tree5640128f593835087f75cf8bf85f96a6a698bd18
parent5a021262ee75705f532aeced2d07cd7fa70e680a
JavaScriptCore:

        Reviewed by Maciej Stachowiak.

        Fixed http://bugs.webkit.org/show_bug.cgi?id=15683
        Re-order declaration initialization to avoid calling hasProperty inside
        VarDeclNode::processDeclaration

        .7% speedup on SunSpider.

        * kjs/function.h:
        * kjs/function.cpp: Merged parameter processing into FunctionBodyNode's
        other processing of declared symbols, so the order of execution could
        change.

        * kjs/nodes.cpp:
        (KJS::VarDeclNode::getDeclarations): Added special case for the
        "arguments" property name, explained in the comment.

        (KJS::VarDeclNode::processDeclaration): Removed call to hasProperty
        in the case of function code, since we know the declared symbol
        management will resolve conflicts between symbols. Yay!

        (KJS::VarDeclListNode::getDeclarations): Now that VarDeclNode's
        implementation of getDeclarations is non-trivial, we can't take a
        short-cut here any longer -- we need to put the VarDecl node on the
        stack so it gets processed normally.

        (KJS::FunctionBodyNode::processDeclarations): Changed the order of
        processing to enforce mutual exclusion rules.

        * kjs/nodes.h:
        (KJS::DeclarationStacks::DeclarationStacks): Structure includes an
        ExecState now, for fast access to the "arguments" property name.

LayoutTests:

        Layout tests for bugs that might result from changes like
        http://bugs.webkit.org/show_bug.cgi?id=15683

        * fast/js/vardecl-preserve-parameters-expected.txt: Added.
        * fast/js/vardecl-preserve-parameters.html: Added.
        * fast/js/vardecl-preserve-vardecl-expected.txt: Added.
        * fast/js/vardecl-preserve-vardecl.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/function.h
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
LayoutTests/ChangeLog
LayoutTests/fast/js/vardecl-preserve-parameters-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/vardecl-preserve-parameters.html [new file with mode: 0644]
LayoutTests/fast/js/vardecl-preserve-vardecl-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/vardecl-preserve-vardecl.html [new file with mode: 0644]