Ignore:
Timestamp:
Dec 20, 2007, 11:21:20 PM (17 years ago)
Author:
[email protected]
Message:

2007-12-17 Eric Seidel <[email protected]>

Reviewed by mjs.

Split IfNode into IfNode and IfElseNode for speedup.
http://bugs.webkit.org/show_bug.cgi?id=16470

SunSpider claims this is 1.003x as fast as before.
(This required running with --runs 15 to get consistent enough results to tell!)

  • kjs/grammar.y:
  • kjs/nodes.cpp: (KJS::IfNode::optimizeVariableAccess): (KJS::IfNode::execute): (KJS::IfNode::getDeclarations): (KJS::IfElseNode::optimizeVariableAccess): (KJS::IfElseNode::execute): (KJS::IfElseNode::getDeclarations):
  • kjs/nodes.h: (KJS::IfNode::): (KJS::IfElseNode::):
  • kjs/nodes2string.cpp: (KJS::IfNode::streamTo): (KJS::IfElseNode::streamTo):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes2string.cpp

    r27702 r28929  
    753753void IfNode::streamTo(SourceStream& s) const
    754754{
    755     s << Endl << "if (" << expr << ')' << Indent << statement1 << Unindent;
    756     if (statement2)
    757         s << Endl << "else" << Indent << statement2 << Unindent;
     755    s << Endl << "if (" << m_condition << ')' << Indent << m_ifBlock << Unindent;
     756}
     757
     758void IfElseNode::streamTo(SourceStream& s) const
     759{
     760    IfNode::streamTo(s);
     761    s << Endl << "else" << Indent << m_elseBlock << Unindent;
    758762}
    759763
Note: See TracChangeset for help on using the changeset viewer.