Changeset 27215 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Oct 28, 2007, 11:49:54 PM (18 years ago)
Author:
mjs
Message:

Reviewed by Darin.



Not a significant speedup or slowdown on SunSpider.

  • kjs/Parser.cpp: (KJS::clearNewNodes):
  • kjs/Parser.h:
  • kjs/grammar.y:
  • kjs/nodes.cpp: (KJS::BlockNode::BlockNode): (KJS::CaseBlockNode::CaseBlockNode): (KJS::FunctionBodyNode::FunctionBodyNode): (KJS::SourceElementsNode::SourceElementsNode): (KJS::ProgramNode::ProgramNode):
  • kjs/nodes.h: (KJS::ElementNode::): (KJS::ArrayNode::): (KJS::PropertyListNode::): (KJS::ObjectLiteralNode::): (KJS::ArgumentListNode::): (KJS::ArgumentsNode::): (KJS::VarDeclListNode::): (KJS::VarStatementNode::): (KJS::ForNode::): (KJS::ParameterNode::): (KJS::FuncExprNode::): (KJS::FuncDeclNode::): (KJS::SourceElementsNode::): (KJS::CaseClauseNode::): (KJS::ClauseListNode::):
Location:
trunk/JavaScriptCore/kjs
Files:
5 edited

Legend:

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

    r18837 r27215  
    3838
    3939static RefPtr<ProgramNode>* progNode;
    40 static HashSet<Node*>* nodeCycles;
    41 
    42 void Parser::noteNodeCycle(Node *node)
    43 {
    44     if (!nodeCycles)
    45         nodeCycles = new HashSet<Node*>;
    46     nodeCycles->add(node);
    47 }
    48 
    49 void Parser::removeNodeCycle(Node *node)
    50 {
    51     ASSERT(nodeCycles);
    52     nodeCycles->remove(node);
    53 }
    54 
    55 static void clearNewNodes()
    56 {
    57     if (nodeCycles) {
    58         for (HashSet<Node*>::iterator it = nodeCycles->begin(); it != nodeCycles->end(); ++it)
    59             (*it)->breakCycle();
    60         delete nodeCycles;
    61         nodeCycles = 0;
    62     }
    63     Node::clearNewNodes();
    64 }
    6540
    6641PassRefPtr<ProgramNode> Parser::parse(const UString& sourceURL, int startingLineNumber,
     
    9166    *progNode = 0;
    9267
    93     clearNewNodes();
     68    Node::clearNewNodes();
    9469
    9570    if (parseError || lexError) {
  • trunk/JavaScriptCore/kjs/Parser.h

    r18837 r27215  
    5454
    5555        static void saveNewNode(Node*);
    56         static void noteNodeCycle(Node*);
    57         static void removeNodeCycle(Node*);
    5856
    5957        static int sid;
  • trunk/JavaScriptCore/kjs/grammar.y

    r27191 r27215  
    8181#endif
    8282
     83struct ElementList {
     84    ElementNode* head;
     85    ElementNode* tail;
     86};
     87
     88struct PropertyList {
     89    PropertyListNode* head;
     90    PropertyListNode* tail;
     91};
     92
     93struct ArgumentList {
     94    ArgumentListNode* head;
     95    ArgumentListNode* tail;
     96};
     97
     98struct VarDeclList {
     99    VarDeclListNode* head;
     100    VarDeclListNode* tail;
     101};
     102
     103struct ParameterList {
     104    ParameterNode* head;
     105    ParameterNode* tail;
     106};
     107
     108struct SourceElementList {
     109    SourceElementsNode* head;
     110    SourceElementsNode* tail;
     111};
     112
     113struct ClauseList {
     114    ClauseListNode* head;
     115    ClauseListNode* tail;
     116};
     117
    83118%}
    84119
     
    90125  Node                *node;
    91126  StatementNode       *stat;
    92   ParameterNode       *param;
     127  ParameterList       param;
    93128  FunctionBodyNode    *body;
    94129  FuncDeclNode        *func;
     
    96131  ProgramNode         *prog;
    97132  AssignExprNode      *init;
    98   SourceElementsNode  *srcs;
     133  SourceElementList   srcs;
    99134  ArgumentsNode       *args;
    100   ArgumentListNode    *alist;
     135  ArgumentList        alist;
    101136  VarDeclNode         *decl;
    102   VarDeclListNode     *vlist;
     137  VarDeclList         vlist;
    103138  CaseBlockNode       *cblk;
    104   ClauseListNode      *clist;
     139  ClauseList          clist;
    105140  CaseClauseNode      *ccl;
    106   ElementNode         *elm;
     141  ElementList         elm;
    107142  Operator            op;
    108   PropertyListNode   *plist;
     143  PropertyList        plist;
    109144  PropertyNode       *pnode;
    110145}
     
    198233%type <cblk>  CaseBlock
    199234%type <ccl>   CaseClause DefaultClause
    200 %type <clist> CaseClauses  CaseClausesOpt
     235%type <clist> CaseClauses CaseClausesOpt
    201236%type <ival>  Elision ElisionOpt
    202237%type <elm>   ElementList
     
    229264  | IDENT IDENT '(' ')' FunctionBody    { $$ = makeGetterOrSetterPropertyNode(*$1, *$2, 0, $5); if (!$$) YYABORT; }
    230265  | IDENT IDENT '(' FormalParameterList ')' FunctionBody
    231                                         { $$ = makeGetterOrSetterPropertyNode(*$1, *$2, $4, $6); if (!$$) YYABORT; }
     266                                        { $$ = makeGetterOrSetterPropertyNode(*$1, *$2, $4.head, $6); if (!$$) YYABORT; }
    232267;
    233268
    234269PropertyList:
    235     Property                            { $$ = new PropertyListNode($1); }
    236   | PropertyList ',' Property           { $$ = new PropertyListNode($3, $1); }
     270    Property                            { $$.head = new PropertyListNode($1);
     271                                          $$.tail = $$.head; }
     272  | PropertyList ',' Property           { $$.head = $1.head;
     273                                          $$.tail = new PropertyListNode($3, $1.tail); }
    237274;
    238275
     
    240277    PrimaryExprNoBrace
    241278  | '{' '}'                             { $$ = new ObjectLiteralNode(); }
    242   | '{' PropertyList '}'                { $$ = new ObjectLiteralNode($2); }
     279  | '{' PropertyList '}'                { $$ = new ObjectLiteralNode($2.head); }
    243280  /* allow extra comma, see http://bugs.webkit.org/show_bug.cgi?id=5939 */
    244   | '{' PropertyList ',' '}'            { $$ = new ObjectLiteralNode($2); }
     281  | '{' PropertyList ',' '}'            { $$ = new ObjectLiteralNode($2.head); }
    245282;
    246283
     
    255292ArrayLiteral:
    256293    '[' ElisionOpt ']'                  { $$ = new ArrayNode($2); }
    257   | '[' ElementList ']'                 { $$ = new ArrayNode($2); }
    258   | '[' ElementList ',' ElisionOpt ']'  { $$ = new ArrayNode($4, $2); }
     294  | '[' ElementList ']'                 { $$ = new ArrayNode($2.head); }
     295  | '[' ElementList ',' ElisionOpt ']'  { $$ = new ArrayNode($4, $2.head); }
    259296;
    260297
    261298ElementList:
    262     ElisionOpt AssignmentExpr           { $$ = new ElementNode($1, $2); }
     299    ElisionOpt AssignmentExpr           { $$.head = new ElementNode($1, $2);
     300                                          $$.tail = $$.head; }
    263301  | ElementList ',' ElisionOpt AssignmentExpr
    264                                         { $$ = new ElementNode($1, $3, $4); }
     302                                        { $$.head = $1.head;
     303                                          $$.tail = new ElementNode($1.tail, $3, $4); }
    265304;
    266305
     
    316355Arguments:
    317356    '(' ')'                             { $$ = new ArgumentsNode(); }
    318   | '(' ArgumentList ')'                { $$ = new ArgumentsNode($2); }
     357  | '(' ArgumentList ')'                { $$ = new ArgumentsNode($2.head); }
    319358;
    320359
    321360ArgumentList:
    322     AssignmentExpr                      { $$ = new ArgumentListNode($1); }
    323   | ArgumentList ',' AssignmentExpr     { $$ = new ArgumentListNode($1, $3); }
     361    AssignmentExpr                      { $$.head = new ArgumentListNode($1);
     362                                          $$.tail = $$.head; }
     363  | ArgumentList ',' AssignmentExpr     { $$.head = $1.head;
     364                                          $$.tail = new ArgumentListNode($1.tail, $3); }
    324365;
    325366
     
    646687Block:
    647688    '{' '}'                             { $$ = new BlockNode(0); DBG($$, @2, @2); }
    648   | '{' SourceElements '}'              { $$ = new BlockNode($2); DBG($$, @3, @3); }
     689  | '{' SourceElements '}'              { $$ = new BlockNode($2.head); DBG($$, @3, @3); }
    649690;
    650691
    651692VariableStatement:
    652     VAR VariableDeclarationList ';'     { $$ = new VarStatementNode($2); DBG($$, @1, @3); }
    653   | VAR VariableDeclarationList error   { $$ = new VarStatementNode($2); DBG($$, @1, @2); AUTO_SEMICOLON; }
     693    VAR VariableDeclarationList ';'     { $$ = new VarStatementNode($2.head); DBG($$, @1, @3); }
     694  | VAR VariableDeclarationList error   { $$ = new VarStatementNode($2.head); DBG($$, @1, @2); AUTO_SEMICOLON; }
    654695;
    655696
    656697VariableDeclarationList:
    657     VariableDeclaration                 { $$ = new VarDeclListNode($1); }
     698    VariableDeclaration                 { $$.head = new VarDeclListNode($1);
     699                                          $$.tail = $$.head; }
    658700  | VariableDeclarationList ',' VariableDeclaration
    659                                         { $$ = new VarDeclListNode($1, $3); }
     701                                        { $$.head = $1.head;
     702                                          $$.tail = new VarDeclListNode($1.tail, $3); }
    660703;
    661704
    662705VariableDeclarationListNoIn:
    663     VariableDeclarationNoIn             { $$ = new VarDeclListNode($1); }
    664   | VariableDeclarationListNoIn ',' VariableDeclarationNoIn
    665                                         { $$ = new VarDeclListNode($1, $3); }
     706    VariableDeclarationNoIn             { $$.head = new VarDeclListNode($1);
     707                                          $$.tail = $$.head; }
     708  | VariableDeclarationListNoIn ',' VariableDeclaration
     709                                        { $$.head = $1.head;
     710                                          $$.tail = new VarDeclListNode($1.tail, $3); }
    666711;
    667712
     
    677722
    678723ConstStatement:
    679     CONSTTOKEN ConstDeclarationList ';' { $$ = new VarStatementNode($2); DBG($$, @1, @3); }
     724    CONSTTOKEN ConstDeclarationList ';' { $$ = new VarStatementNode($2.head); DBG($$, @1, @3); }
    680725  | CONSTTOKEN ConstDeclarationList error
    681                                         { $$ = new VarStatementNode($2); DBG($$, @1, @2); AUTO_SEMICOLON; }
     726                                        { $$ = new VarStatementNode($2.head); DBG($$, @1, @2); AUTO_SEMICOLON; }
    682727;
    683728
    684729ConstDeclarationList:
    685     ConstDeclaration                    { $$ = new VarDeclListNode($1); }
     730    ConstDeclaration                    { $$.head = new VarDeclListNode($1);
     731                                          $$.tail = $$.head; }
    686732  | ConstDeclarationList ',' ConstDeclaration
    687                                         { $$ = new VarDeclListNode($1, $3); }
     733                                        { $$.head = $1.head;
     734                                          $$.tail = new VarDeclListNode($1.tail, $3); }
    688735;
    689736
     
    724771                                        { $$ = new ForNode($3, $5, $7, $9); DBG($$, @1, @8); }
    725772  | FOR '(' VAR VariableDeclarationListNoIn ';' ExprOpt ';' ExprOpt ')' Statement
    726                                         { $$ = new ForNode($4, $6, $8, $10); DBG($$, @1, @9); }
     773                                        { $$ = new ForNode($4.head, $6, $8, $10); DBG($$, @1, @9); }
    727774  | FOR '(' LeftHandSideExpr INTOKEN Expr ')' Statement
    728775                                        {
     
    779826
    780827CaseBlock:
    781     '{' CaseClausesOpt '}'              { $$ = new CaseBlockNode($2, 0, 0); }
     828    '{' CaseClausesOpt '}'              { $$ = new CaseBlockNode($2.head, 0, 0); }
    782829  | '{' CaseClausesOpt DefaultClause CaseClausesOpt '}'
    783                                         { $$ = new CaseBlockNode($2, $3, $4); }
     830                                        { $$ = new CaseBlockNode($2.head, $3, $4.head); }
    784831;
    785832
    786833CaseClausesOpt:
    787     /* nothing */                       { $$ = 0; }
     834    /* nothing */                       { $$.head = 0; $$.tail = 0; }
    788835  | CaseClauses
    789836;
    790837
    791838CaseClauses:
    792     CaseClause                          { $$ = new ClauseListNode($1); }
    793   | CaseClauses CaseClause              { $$ = new ClauseListNode($1, $2); }
     839    CaseClause                          { $$.head = new ClauseListNode($1);
     840                                          $$.tail = $$.head; }
     841  | CaseClauses CaseClause              { $$.head = $1.head;
     842                                          $$.tail = new ClauseListNode($1.tail, $2); }
    794843;
    795844
    796845CaseClause:
    797846    CASE Expr ':'                       { $$ = new CaseClauseNode($2); }
    798   | CASE Expr ':' SourceElements        { $$ = new CaseClauseNode($2, $4); }
     847  | CASE Expr ':' SourceElements        { $$ = new CaseClauseNode($2, $4.head); }
    799848;
    800849
    801850DefaultClause:
    802851    DEFAULT ':'                         { $$ = new CaseClauseNode(0); }
    803   | DEFAULT ':' SourceElements          { $$ = new CaseClauseNode(0, $3); }
     852  | DEFAULT ':' SourceElements          { $$ = new CaseClauseNode(0, $3.head); }
    804853;
    805854
     
    828877    FUNCTION IDENT '(' ')' FunctionBody { $$ = new FuncDeclNode(*$2, $5); }
    829878  | FUNCTION IDENT '(' FormalParameterList ')' FunctionBody
    830                                         { $$ = new FuncDeclNode(*$2, $4, $6); }
     879                                        { $$ = new FuncDeclNode(*$2, $4.head, $6); }
    831880;
    832881
     
    834883    FUNCTION '(' ')' FunctionBody       { $$ = new FuncExprNode(CommonIdentifiers::shared()->nullIdentifier, $4); }
    835884  | FUNCTION '(' FormalParameterList ')' FunctionBody
    836                                         { $$ = new FuncExprNode(CommonIdentifiers::shared()->nullIdentifier, $5, $3); }
     885                                        { $$ = new FuncExprNode(CommonIdentifiers::shared()->nullIdentifier, $5, $3.head); }
    837886  | FUNCTION IDENT '(' ')' FunctionBody { $$ = new FuncExprNode(*$2, $5); }
    838887  | FUNCTION IDENT '(' FormalParameterList ')' FunctionBody
    839                                         { $$ = new FuncExprNode(*$2, $6, $4); }
     888                                        { $$ = new FuncExprNode(*$2, $6, $4.head); }
    840889;
    841890
    842891FormalParameterList:
    843     IDENT                               { $$ = new ParameterNode(*$1); }
    844   | FormalParameterList ',' IDENT       { $$ = new ParameterNode($1, *$3); }
     892    IDENT                               { $$.head = new ParameterNode(*$1);
     893                                          $$.tail = $$.head; }
     894  | FormalParameterList ',' IDENT       { $$.head = $1.head;
     895                                          $$.tail = new ParameterNode($1.tail, *$3); }
    845896;
    846897
    847898FunctionBody:
    848899    '{' '}' /* not in spec */           { $$ = new FunctionBodyNode(0); DBG($$, @1, @2); }
    849   | '{' SourceElements '}'              { $$ = new FunctionBodyNode($2); DBG($$, @1, @3); }
     900  | '{' SourceElements '}'              { $$ = new FunctionBodyNode($2.head); DBG($$, @1, @3); }
    850901;
    851902
    852903Program:
    853904    /* not in spec */                   { Parser::accept(new ProgramNode(0)); }
    854     | SourceElements                    { Parser::accept(new ProgramNode($1)); }
     905    | SourceElements                    { Parser::accept(new ProgramNode($1.head)); }
    855906;
    856907
    857908SourceElements:
    858     SourceElement                       { $$ = new SourceElementsNode($1); }
    859   | SourceElements SourceElement        { $$ = new SourceElementsNode($1, $2); }
     909    SourceElement                       { $$.head = new SourceElementsNode($1);
     910                                          $$.tail = $$.head; }
     911  | SourceElements SourceElement        { $$.head = $1.head;
     912                                          $$.tail = new SourceElementsNode($1.tail, $2); }
    860913;
    861914
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r27210 r27215  
    459459}
    460460
    461 void ElementNode::breakCycle()
    462 {
    463     next = 0;
    464 }
    465 
    466461// ------------------------------ ArrayNode ------------------------------------
    467462
     
    548543}
    549544
    550 void PropertyListNode::breakCycle()
    551 {
    552     next = 0;
    553 }
    554 
    555545// ------------------------------ PropertyNode -----------------------------
    556546
     
    633623
    634624  return l;
    635 }
    636 
    637 void ArgumentListNode::breakCycle()
    638 {
    639     next = 0;
    640625}
    641626
     
    22802265}
    22812266
    2282 void VarDeclListNode::breakCycle()
    2283 {
    2284     next = 0;
    2285 }
    2286 
    22872267// ------------------------------ VarStatementNode -----------------------------
    22882268
     
    23182298}
    23192299
    2320 BlockNode::BlockNode(SourceElementsNode *s)
     2300BlockNode::BlockNode(SourceElementsNode* s)
    23212301{
    23222302  if (s) {
    23232303    m_mayHaveDeclarations = true;
    2324     source = s->next.release();
    2325     Parser::removeNodeCycle(source.get());
     2304    source = s;
    23262305    setLoc(s->firstLine(), s->lastLine());
    23272306  } else {
     
    28522831}
    28532832
    2854 void ClauseListNode::breakCycle()
    2855 {
    2856     next = 0;
    2857 }
    2858 
    28592833// ------------------------------ CaseBlockNode --------------------------------
    28602834
    2861 CaseBlockNode::CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d,
    2862                              ClauseListNode *l2)
    2863 {
    2864   m_mayHaveDeclarations = true;
    2865   if (l1) {
    2866     list1 = l1->next.release();
    2867     Parser::removeNodeCycle(list1.get());
    2868   } else {
    2869     list1 = 0;
    2870   }
    2871 
    2872   def = d;
    2873 
    2874   if (l2) {
    2875     list2 = l2->next.release();
    2876     Parser::removeNodeCycle(list2.get());
    2877   } else {
    2878     list2 = 0;
    2879   }
     2835CaseBlockNode::CaseBlockNode(ClauseListNode* l1, CaseClauseNode* d, ClauseListNode* l2)
     2836    : list1(l1)
     2837    , def(d)
     2838    , list2(l2)
     2839{
     2840    m_mayHaveDeclarations = true;
    28802841}
    28812842 
     
    31013062}
    31023063
    3103 void ParameterNode::breakCycle()
    3104 {
    3105     next = 0;
    3106 }
    3107 
    31083064// ------------------------------ FunctionBodyNode -----------------------------
    31093065
    3110 FunctionBodyNode::FunctionBodyNode(SourceElementsNode *s)
     3066FunctionBodyNode::FunctionBodyNode(SourceElementsNode* s)
    31113067    : BlockNode(s)
    31123068    , m_sourceURL(Lexer::curr()->sourceURL())
     
    33493305int SourceElementsNode::count = 0;
    33503306
    3351 SourceElementsNode::SourceElementsNode(StatementNode *s1)
    3352   : node(s1), next(this)
     3307SourceElementsNode::SourceElementsNode(StatementNode* s1)
     3308  : node(s1)
    33533309{
    33543310    m_mayHaveDeclarations = true;
    3355     Parser::noteNodeCycle(this);
    33563311    setLoc(s1->firstLine(), s1->lastLine());
    33573312}
    33583313
    3359 SourceElementsNode::SourceElementsNode(SourceElementsNode *s1, StatementNode *s2)
    3360   : node(s2), next(s1->next)
     3314SourceElementsNode::SourceElementsNode(SourceElementsNode* s1, StatementNode* s2)
     3315  : node(s2)
    33613316{
    33623317  m_mayHaveDeclarations = true;
     
    34013356}
    34023357
    3403 void SourceElementsNode::breakCycle()
    3404 {
    3405     next = 0;
    3406 }
    3407 
    3408 ProgramNode::ProgramNode(SourceElementsNode *s) : FunctionBodyNode(s)
    3409 {
    3410 }
    3411 
    3412 }
     3358ProgramNode::ProgramNode(SourceElementsNode* s)
     3359    : FunctionBodyNode(s)
     3360{
     3361}
     3362
     3363}
  • trunk/JavaScriptCore/kjs/nodes.h

    r27210 r27215  
    143143    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL { }
    144144
    145     virtual void breakCycle() KJS_FAST_CALL { }
    146 
    147145  protected:
    148146    Completion createErrorCompletion(ExecState *, ErrorType, const char *msg) KJS_FAST_CALL;
     
    307305  class ElementNode : public Node {
    308306  public:
    309     // list pointer is tail of a circular list, cracked in the ArrayNode ctor
    310     ElementNode(int e, Node *n) KJS_FAST_CALL : next(this), elision(e), node(n) { Parser::noteNodeCycle(this); }
    311     ElementNode(ElementNode *l, int e, Node *n) KJS_FAST_CALL
    312       : next(l->next), elision(e), node(n) { l->next = this; }
     307    ElementNode(int e, Node* n) KJS_FAST_CALL : elision(e), node(n) { }
     308    ElementNode(ElementNode* l, int e, Node* n) KJS_FAST_CALL
     309      : elision(e), node(n) { l->next = this; }
    313310    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    314311    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    315312    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    316313    PassRefPtr<ElementNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    317     virtual void breakCycle() KJS_FAST_CALL;
    318314    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
    319315  private:
     
    327323  public:
    328324    ArrayNode(int e) KJS_FAST_CALL : elision(e), opt(true) { }
    329     ArrayNode(ElementNode *ele) KJS_FAST_CALL
    330       : element(ele->next.release()), elision(0), opt(false) { Parser::removeNodeCycle(element.get()); }
    331     ArrayNode(int eli, ElementNode *ele) KJS_FAST_CALL
    332       : element(ele->next.release()), elision(eli), opt(true) { Parser::removeNodeCycle(element.get()); }
     325    ArrayNode(ElementNode* ele) KJS_FAST_CALL
     326      : element(ele), elision(0), opt(false) { }
     327    ArrayNode(int eli, ElementNode* ele) KJS_FAST_CALL
     328      : element(ele), elision(eli), opt(true) { }
    333329    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    334330    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    360356  class PropertyListNode : public Node {
    361357  public:
    362     // list pointer is tail of a circular list, cracked in the ObjectLiteralNode ctor
    363     PropertyListNode(PropertyNode *n) KJS_FAST_CALL
    364       : node(n), next(this) { Parser::noteNodeCycle(this); }
    365     PropertyListNode(PropertyNode *n, PropertyListNode *l) KJS_FAST_CALL
    366       : node(n), next(l->next) { l->next = this; }
     358    PropertyListNode(PropertyNode* n) KJS_FAST_CALL
     359      : node(n) { }
     360    PropertyListNode(PropertyNode* n, PropertyListNode* l) KJS_FAST_CALL
     361      : node(n) { l->next = this; }
    367362    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    368363    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    369364    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    370365    PassRefPtr<PropertyListNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    371     virtual void breakCycle() KJS_FAST_CALL;
    372366    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
    373367  private:
     
    380374  public:
    381375    ObjectLiteralNode() KJS_FAST_CALL { }
    382     ObjectLiteralNode(PropertyListNode *l) KJS_FAST_CALL : list(l->next.release()) { Parser::removeNodeCycle(list.get()); }
     376    ObjectLiteralNode(PropertyListNode* l) KJS_FAST_CALL : list(l) { }
    383377    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    384378    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    427421  class ArgumentListNode : public Node {
    428422  public:
    429     // list pointer is tail of a circular list, cracked in the ArgumentsNode ctor
    430     ArgumentListNode(Node *e) KJS_FAST_CALL : next(this), expr(e) { Parser::noteNodeCycle(this); }
    431     ArgumentListNode(ArgumentListNode *l, Node *e) KJS_FAST_CALL
    432       : next(l->next), expr(e) { l->next = this; }
     423    ArgumentListNode(Node* e) KJS_FAST_CALL : expr(e) { }
     424    ArgumentListNode(ArgumentListNode* l, Node* e) KJS_FAST_CALL
     425      : expr(e) { l->next = this; }
    433426    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    434427    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    436429    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    437430    PassRefPtr<ArgumentListNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    438     virtual void breakCycle() KJS_FAST_CALL;
    439431    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
    440432  private:
     
    447439  public:
    448440    ArgumentsNode() KJS_FAST_CALL { }
    449     ArgumentsNode(ArgumentListNode *l) KJS_FAST_CALL
    450       : list(l->next.release()) { Parser::removeNodeCycle(list.get()); }
     441    ArgumentsNode(ArgumentListNode* l) KJS_FAST_CALL
     442      : list(l) { }
    451443    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    452444    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    12151207  class VarDeclListNode : public Node {
    12161208  public:
    1217     // list pointer is tail of a circular list, cracked in the ForNode/VarStatementNode ctor
    1218     VarDeclListNode(VarDeclNode *v) KJS_FAST_CALL : next(this), var(v) { Parser::noteNodeCycle(this); m_mayHaveDeclarations = true; }
    1219     VarDeclListNode(VarDeclListNode *l, VarDeclNode *v) KJS_FAST_CALL
    1220       : next(l->next), var(v) { l->next = this; m_mayHaveDeclarations = true; }
     1209    VarDeclListNode(VarDeclNode* v) KJS_FAST_CALL : var(v) { m_mayHaveDeclarations = true; }
     1210    VarDeclListNode(VarDeclListNode* l, VarDeclNode* v) KJS_FAST_CALL
     1211      : var(v) { l->next = this; m_mayHaveDeclarations = true; }
    12211212    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    12221213    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    12231214    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    12241215    PassRefPtr<VarDeclListNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    1225     virtual void breakCycle() KJS_FAST_CALL;
    12261216    virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    12271217    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
     
    12351225  class VarStatementNode : public StatementNode {
    12361226  public:
    1237     VarStatementNode(VarDeclListNode *l) KJS_FAST_CALL : next(l->next.release()) { Parser::removeNodeCycle(next.get()); m_mayHaveDeclarations = true; }
     1227    VarStatementNode(VarDeclListNode* l) KJS_FAST_CALL : next(l) { m_mayHaveDeclarations = true; }
    12381228    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    12391229    virtual Completion execute(ExecState*) KJS_FAST_CALL;
     
    13121302  class ForNode : public StatementNode {
    13131303  public:
    1314     ForNode(Node *e1, Node *e2, Node *e3, StatementNode *s) KJS_FAST_CALL :
     1304    ForNode(Node* e1, Node* e2, Node* e3, StatementNode* s) KJS_FAST_CALL :
    13151305      expr1(e1), expr2(e2), expr3(e3), statement(s) { m_mayHaveDeclarations = true; }
    1316     ForNode(VarDeclListNode *e1, Node *e2, Node *e3, StatementNode *s) KJS_FAST_CALL :
    1317       expr1(e1->next.release()), expr2(e2), expr3(e3), statement(s) { Parser::removeNodeCycle(expr1.get()); m_mayHaveDeclarations = true; }
    13181306    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    13191307    virtual Completion execute(ExecState*) KJS_FAST_CALL;
     
    14251413  class ParameterNode : public Node {
    14261414  public:
    1427     // list pointer is tail of a circular list, cracked in the FuncDeclNode/FuncExprNode ctor
    1428     ParameterNode(const Identifier &i) KJS_FAST_CALL : id(i), next(this) { Parser::noteNodeCycle(this); }
    1429     ParameterNode(ParameterNode *next, const Identifier &i) KJS_FAST_CALL
    1430       : id(i), next(next->next) { next->next = this; }
     1415    ParameterNode(const Identifier& i) KJS_FAST_CALL : id(i) { }
     1416    ParameterNode(ParameterNode* l, const Identifier& i) KJS_FAST_CALL
     1417      : id(i) { l->next = this; }
    14311418    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    14321419    Identifier ident() KJS_FAST_CALL { return id; }
     
    14341421    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    14351422    PassRefPtr<ParameterNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    1436     virtual void breakCycle() KJS_FAST_CALL;
    14371423    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
    14381424  private:
     
    14861472  class FuncExprNode : public Node {
    14871473  public:
    1488     FuncExprNode(const Identifier &i, FunctionBodyNode *b, ParameterNode *p = 0) KJS_FAST_CALL
    1489       : ident(i), param(p ? p->next.release() : 0), body(b) { if (p) { Parser::removeNodeCycle(param.get()); } addParams(); }
     1474    FuncExprNode(const Identifier& i, FunctionBodyNode* b, ParameterNode* p = 0) KJS_FAST_CALL
     1475      : ident(i), param(p), body(b) { addParams(); }
    14901476    virtual JSValue *evaluate(ExecState*) KJS_FAST_CALL;
    14911477    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
     
    15021488  class FuncDeclNode : public StatementNode {
    15031489  public:
    1504     FuncDeclNode(const Identifier &i, FunctionBodyNode *b) KJS_FAST_CALL
     1490    FuncDeclNode(const Identifier& i, FunctionBodyNode* b) KJS_FAST_CALL
    15051491      : ident(i), body(b) { addParams(); m_mayHaveDeclarations = true; }
    1506     FuncDeclNode(const Identifier &i, ParameterNode *p, FunctionBodyNode *b) KJS_FAST_CALL
    1507       : ident(i), param(p->next.release()), body(b) { Parser::removeNodeCycle(param.get()); addParams(); m_mayHaveDeclarations = true; }
     1492    FuncDeclNode(const Identifier& i, ParameterNode* p, FunctionBodyNode* b) KJS_FAST_CALL
     1493      : ident(i), param(p), body(b) { addParams(); m_mayHaveDeclarations = true; }
    15081494    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    15091495    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
     
    15211507  public:
    15221508    static int count;
    1523     // list pointer is tail of a circular list, cracked in the BlockNode (or subclass) ctor
    15241509    SourceElementsNode(StatementNode*) KJS_FAST_CALL;
    1525     SourceElementsNode(SourceElementsNode *s1, StatementNode *s2) KJS_FAST_CALL;
     1510    SourceElementsNode(SourceElementsNode*, StatementNode*) KJS_FAST_CALL;
    15261511   
    15271512    virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
     
    15291514    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    15301515    PassRefPtr<SourceElementsNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    1531     virtual void breakCycle() KJS_FAST_CALL;
    15321516    virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    15331517  private:
     
    15421526      CaseClauseNode(Node *e) KJS_FAST_CALL : expr(e) { m_mayHaveDeclarations = true; }
    15431527      CaseClauseNode(Node *e, SourceElementsNode *s) KJS_FAST_CALL
    1544       : expr(e), source(s->next.release()) { Parser::removeNodeCycle(source.get()); m_mayHaveDeclarations = true; }
     1528      : expr(e), source(s) { m_mayHaveDeclarations = true; }
    15451529      virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    15461530      JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    15561540  class ClauseListNode : public Node {
    15571541  public:
    1558       // list pointer is tail of a circular list, cracked in the CaseBlockNode ctor
    1559       ClauseListNode(CaseClauseNode *c) KJS_FAST_CALL : clause(c), next(this) { Parser::noteNodeCycle(this); m_mayHaveDeclarations = true; }
    1560       ClauseListNode(ClauseListNode *n, CaseClauseNode *c) KJS_FAST_CALL
    1561       : clause(c), next(n->next) { n->next = this; m_mayHaveDeclarations = true; }
     1542      ClauseListNode(CaseClauseNode* c) KJS_FAST_CALL : clause(c) { m_mayHaveDeclarations = true; }
     1543      ClauseListNode(ClauseListNode* n, CaseClauseNode* c) KJS_FAST_CALL
     1544      : clause(c) { n->next = this; m_mayHaveDeclarations = true; }
    15621545      virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    15631546      JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    15661549      virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    15671550      PassRefPtr<ClauseListNode> releaseNext() KJS_FAST_CALL { return next.release(); }
    1568       virtual void breakCycle() KJS_FAST_CALL;
    15691551      virtual void getDeclarations(DeclarationStacks&) KJS_FAST_CALL;
    15701552      virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
     
    15771559  class CaseBlockNode : public Node {
    15781560  public:
    1579       CaseBlockNode(ClauseListNode *l1, CaseClauseNode *d, ClauseListNode *l2) KJS_FAST_CALL;
     1561      CaseBlockNode(ClauseListNode* l1, CaseClauseNode* d, ClauseListNode* l2) KJS_FAST_CALL;
    15801562      virtual void optimizeVariableAccess(FunctionBodyNode*, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    15811563      JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     
    16041586  class ProgramNode : public FunctionBodyNode {
    16051587  public:
    1606     ProgramNode(SourceElementsNode *s) KJS_FAST_CALL;
     1588    ProgramNode(SourceElementsNode* s) KJS_FAST_CALL;
    16071589  };
    16081590
Note: See TracChangeset for help on using the changeset viewer.