Ignore:
Timestamp:
Oct 31, 2007, 3:54:37 AM (18 years ago)
Author:
oliver
Message:

Remove SourceCodeElement class and replaced with a Vector for a 0.8% gain on sunspider

Reviewed by Maciej

File:
1 edited

Legend:

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

    r27255 r27308  
    729729}
    730730
     731static inline void statementListStreamTo(Vector<RefPtr<StatementNode> >* nodes, SourceStream& s)
     732{
     733    if (!nodes)
     734        return;
     735   
     736    for (Vector<RefPtr<StatementNode> >::iterator ptr = nodes->begin(); ptr != nodes->end(); ptr++)
     737        s << *ptr;
     738}
     739   
    731740void BlockNode::streamTo(SourceStream& s) const
    732741{
    733     s << Endl << "{" << Indent << source << Unindent << Endl << "}";
     742    s << Endl << "{" << Indent;
     743    statementListStreamTo(m_children.get(), s);
     744    s << Unindent << Endl << "}";
    734745}
    735746
     
    818829    else
    819830        s << "default";
    820     s << ":" << Indent << source << Unindent;
     831    s << ":" << Indent;
     832    statementListStreamTo(m_children.get(), s);
     833    s << Unindent;
    821834}
    822835
     
    879892}
    880893
    881 void SourceElementsNode::streamTo(SourceStream& s) const
    882 {
    883     for (const SourceElementsNode* n = this; n; n = n->next.get())
    884         s << n->node;
    885 }
    886 
    887 }
     894}
Note: See TracChangeset for help on using the changeset viewer.