Ignore:
Timestamp:
Dec 24, 2007, 2:13:00 AM (18 years ago)
Author:
[email protected]
Message:

Reviewed by Eric.


3.5% speedup on SunSpider.

var statements now result in either assignments or empty statements.


This allows a couple of optimization opportunities:

  • No need to branch at runtime to check if there is an initializer
  • EmptyStatementNodes can be removed entirely (also done in this patch)
  • Assignment expressions get properly optimized for local variables


This patch also includes some code cleanup:

  • Most of the old VarStatement/VarDecl logic is now only used for const declarations, thus it is renamed appropriately
  • AssignExprNode is gone


  • JavaScriptCore.exp:
  • kjs/NodeInfo.h:
  • kjs/grammar.y:
  • kjs/nodes.cpp: (KJS::SourceElements::append): (KJS::ConstDeclNode::ConstDeclNode): (KJS::ConstDeclNode::optimizeVariableAccess): (KJS::ConstDeclNode::handleSlowCase): (KJS::ConstDeclNode::evaluateSingle): (KJS::ConstDeclNode::evaluate): (KJS::ConstStatementNode::optimizeVariableAccess): (KJS::ConstStatementNode::execute): (KJS::VarStatementNode::optimizeVariableAccess): (KJS::VarStatementNode::execute): (KJS::ForInNode::ForInNode): (KJS::ForInNode::optimizeVariableAccess): (KJS::ForInNode::execute): (KJS::FunctionBodyNode::initializeSymbolTable): (KJS::ProgramNode::initializeSymbolTable): (KJS::FunctionBodyNode::processDeclarations): (KJS::ProgramNode::processDeclarations): (KJS::EvalNode::processDeclarations):
  • kjs/nodes.h: (KJS::DeclarationStacks::): (KJS::StatementNode::): (KJS::ConstDeclNode::): (KJS::ConstStatementNode::): (KJS::EmptyStatementNode::): (KJS::VarStatementNode::): (KJS::ForNode::):
  • kjs/nodes2string.cpp: (KJS::ConstDeclNode::streamTo): (KJS::ConstStatementNode::streamTo): (KJS::ScopeNode::streamTo): (KJS::VarStatementNode::streamTo): (KJS::ForNode::streamTo): (KJS::ForInNode::streamTo):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r28950 r28973  
    121121__ZN3KJS11JSImmediate8toObjectEPKNS_7JSValueEPNS_9ExecStateE
    122122__ZN3KJS11JSImmediate8toStringEPKNS_7JSValueE
    123 __ZN3KJS11ProgramNodeC1EPNS_14SourceElementsEPN3WTF6VectorIPNS_11VarDeclNodeELm16EEEPNS4_IPNS_12FuncDeclNodeELm16EEE
     123__ZN3KJS11ProgramNodeC1EPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS4_IPNS_12FuncDeclNodeELm16EEE
    124124__ZN3KJS11PropertyMap11getLocationERKNS_10IdentifierE
    125125__ZN3KJS11PropertyMap5clearEv
Note: See TracChangeset for help on using the changeset viewer.