Changeset 27025 in webkit for trunk/JavaScriptCore/kjs/function.h


Ignore:
Timestamp:
Oct 25, 2007, 12:09:44 AM (18 years ago)
Author:
ggaren
Message:

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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function.h

    r26808 r27025  
    108108    static JSValue* callerGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
    109109    static JSValue* lengthGetter(ExecState*, JSObject*, const Identifier&, const PropertySlot&);
    110 
    111     void passInParameters(ExecState*, const List&);
    112110  };
    113111
Note: See TracChangeset for help on using the changeset viewer.