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


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/nodes.h

    r27255 r27308  
    4949    class FuncDeclNode;
    5050    class PropertyListNode;
    51     class SourceElementsNode;
    5251    class SourceStream;
    5352    class VarDeclNode;
     
    15071506  class BlockNode : public StatementNode {
    15081507  public:
    1509     BlockNode(SourceElementsNode *s) KJS_FAST_CALL;
     1508    BlockNode(Vector<RefPtr<StatementNode> > *children) KJS_FAST_CALL;
    15101509    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    15111510    virtual Completion execute(ExecState*) KJS_FAST_CALL;
     
    15131512    virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    15141513  protected:
    1515     RefPtr<SourceElementsNode> source;
     1514    OwnPtr<Vector<RefPtr<StatementNode> > > m_children;
    15161515  };
    15171516
     
    17031702  class FunctionBodyNode : public BlockNode {
    17041703  public:
    1705     FunctionBodyNode(SourceElementsNode *) KJS_FAST_CALL;
     1704    FunctionBodyNode(Vector<RefPtr<StatementNode> > *children) KJS_FAST_CALL;
    17061705    int sourceId() KJS_FAST_CALL { return m_sourceId; }
    17071706    const UString& sourceURL() KJS_FAST_CALL { return m_sourceURL; }
     
    17741773  };
    17751774
    1776   // A linked list of source element nodes
    1777   class SourceElementsNode : public StatementNode {
    1778   public:
    1779     static int count;
    1780     SourceElementsNode(StatementNode*) KJS_FAST_CALL;
    1781     SourceElementsNode(SourceElementsNode*, StatementNode*) KJS_FAST_CALL;
    1782    
    1783     virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1784     Completion execute(ExecState*) KJS_FAST_CALL;
    1785     virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    1786     PassRefPtr<SourceElementsNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    1787     virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    1788   private:
    1789     friend class BlockNode;
    1790     friend class CaseClauseNode;
    1791     RefPtr<StatementNode> node;
    1792     ListRefPtr<SourceElementsNode> next;
    1793   };
    1794 
    17951775  class CaseClauseNode : public Node {
    17961776  public:
    17971777      CaseClauseNode(Node *e) KJS_FAST_CALL : expr(e) { m_mayHaveDeclarations = true; }
    1798       CaseClauseNode(Node *e, SourceElementsNode *s) KJS_FAST_CALL
    1799       : expr(e), source(s) { m_mayHaveDeclarations = true; }
     1778      CaseClauseNode(Node *e, Vector<RefPtr<StatementNode> > *children) KJS_FAST_CALL
     1779      : expr(e), m_children(children) { m_mayHaveDeclarations = true; }
    18001780      virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    18011781      JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    18061786  private:
    18071787      RefPtr<Node> expr;
    1808       RefPtr<SourceElementsNode> source;
     1788      OwnPtr<Vector<RefPtr<StatementNode> > > m_children;
    18091789  };
    18101790 
     
    18571837  class ProgramNode : public FunctionBodyNode {
    18581838  public:
    1859     ProgramNode(SourceElementsNode* s) KJS_FAST_CALL;
     1839    ProgramNode(Vector<RefPtr<StatementNode> > *children) KJS_FAST_CALL;
    18601840  };
    18611841
     
    18851865  };
    18861866
    1887   struct SourceElementList {
    1888       SourceElementsNode* head;
    1889       SourceElementsNode* tail;
    1890   };
    1891 
    18921867  struct ClauseList {
    18931868      ClauseListNode* head;
Note: See TracChangeset for help on using the changeset viewer.