Changeset 26811 in webkit for trunk/JavaScriptCore/kjs/nodes.h


Ignore:
Timestamp:
Oct 20, 2007, 12:11:53 AM (18 years ago)
Author:
ggaren
Message:

Reviewed by Maciej Stachowiak.

Fixed http://bugs.webkit.org/show_bug.cgi?id=15570
Store gathered declaration nodes in the function body node.


This means that you only have to gather the declaration nodes the first
time the function executes. Performance gain of 2.10% on SunSpider,
0.90% on command-line JS iBench.

  • kjs/nodes.cpp: Split declaration stack initialization code off into initializeDeclarationStacks(). (FunctionBodyNode::FunctionBodyNode): (FunctionBodyNode::initializeDeclarationStacks): (FunctionBodyNode::processDeclarations):
  • kjs/nodes.h: Changed DeclarationStacks structure to hold references, since the actual Vectors are now stored either on the stack or in the function body node.
File:
1 edited

Legend:

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

    r26808 r26811  
    9090      typedef Vector<FuncDeclNode*, 16> FunctionStack;
    9191     
    92       NodeStack nodeStack;
    93       VarStack varStack;
    94       FunctionStack functionStack;
     92      DeclarationStacks(NodeStack& n, VarStack& v, FunctionStack& f)
     93        : nodeStack(n)
     94        , varStack(v)
     95        , functionStack(f)
     96      {
     97      }
     98       
     99      NodeStack& nodeStack;
     100      VarStack& varStack;
     101      FunctionStack& functionStack;
    95102  };
    96103
     
    10571064    int m_sourceId;
    10581065    Vector<Identifier> m_parameters;
     1066
     1067    void initializeDeclarationStacks();
     1068    bool m_initializedDeclarationStacks;
     1069    DeclarationStacks::VarStack m_varStack;
     1070    DeclarationStacks::FunctionStack m_functionStack;
    10591071  };
    10601072
Note: See TracChangeset for help on using the changeset viewer.