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


Ignore:
Timestamp:
Oct 25, 2007, 1:11:31 AM (18 years ago)
Author:
ggaren
Message:

Reviewed by Maciej Stachowiak.


Make a fast path for declaration processing inside Function Code.


Lifted declaration processing code up from individual declaration nodes
and into processDeclarations.


Broke out processDeclarations into two cases, depending on the type of
code. This eliminates 2 branches, and facilitates more radical
divergeance in the future.


2.5% SunSpider speedup.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/nodes.cpp: (KJS::FunctionBodyNode::initializeDeclarationStacks): (KJS::FunctionBodyNode::processDeclarationsFunctionCode): (KJS::FunctionBodyNode::processDeclarationsProgramCode): (KJS::FunctionBodyNode::execute): (KJS::FuncDeclNode::makeFunction):
  • kjs/nodes.h: (KJS::):
File:
1 edited

Legend:

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

    r27025 r27028  
    10051005    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    10061006    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    1007     ALWAYS_INLINE void processDeclaration(ExecState*) KJS_FAST_CALL;
    10081007    virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    1009   private:
    1010     JSValue* handleSlowCase(ExecState*, const ScopeChain&, JSValue*) KJS_FAST_CALL KJS_NO_INLINE;
    10111008    Type varType;
    10121009    Identifier ident;
     1010  private:
     1011    JSValue* handleSlowCase(ExecState*, const ScopeChain&, JSValue*) KJS_FAST_CALL KJS_NO_INLINE;
    10131012    RefPtr<AssignExprNode> init;
    10141013  };
     
    12421241    UString paramString() const KJS_FAST_CALL;
    12431242    Vector<Identifier>& parameters() KJS_FAST_CALL { return m_parameters; }
    1244     ALWAYS_INLINE void processDeclarations(ExecState*) KJS_FAST_CALL;
     1243    ALWAYS_INLINE void processDeclarations(ExecState*);
     1244    ALWAYS_INLINE void processDeclarationsFunctionCode(ExecState*);
     1245    ALWAYS_INLINE void processDeclarationsProgramCode(ExecState*);
    12451246  private:
    12461247    UString m_sourceURL;
     
    12501251    bool m_initializedDeclarationStacks;
    12511252
     1253    // Properties that will go into the ActivationImp's symbol table. (Used for initializing the ActivationImp.)
    12521254    DeclarationStacks::VarStack m_varStack;
    12531255    DeclarationStacks::FunctionStack m_functionStack;
     
    12791281    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    12801282    virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    1281     ALWAYS_INLINE void processDeclaration(ExecState*) KJS_FAST_CALL;
     1283    ALWAYS_INLINE FunctionImp* makeFunction(ExecState*) KJS_FAST_CALL;
     1284    Identifier ident;
    12821285  private:
    12831286    void addParams() KJS_FAST_CALL;
    1284     Identifier ident;
    12851287    RefPtr<ParameterNode> param;
    12861288    RefPtr<FunctionBodyNode> body;
Note: See TracChangeset for help on using the changeset viewer.