Bug 701620 - Rename PNK_DO to PNK_DOWHILE to make the meaning clearer. r=jorendorff
authorJeff Walden <jwalden@mit.edu>
Sun, 06 Nov 2011 07:51:39 -0800
changeset 80885 c7099e04ec39335acf8483b71fede74304b0d7d9
parent 80884 1030be78cb5126ec2644fc23e9e8c9c54632edc1
child 80886 db3280d6199df7f1d356c126efb3a1ea2faa2ac8
push id21539
push usermak77@bonardo.net
push dateTue, 29 Nov 2011 12:03:36 +0000
treeherdermozilla-central@e320f9f5536f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs701620
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 701620 - Rename PNK_DO to PNK_DOWHILE to make the meaning clearer. r=jorendorff
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/FoldConstants.cpp
js/src/frontend/ParseNode.h
js/src/frontend/Parser.cpp
js/src/jsreflect.cpp
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -5994,17 +5994,17 @@ frontend::EmitTree(JSContext *cx, Byteco
          */
         if (!SetSrcNoteOffset(cx, bce, noteIndex2, 0, beq - top))
             return JS_FALSE;
         if (!SetSrcNoteOffset(cx, bce, noteIndex, 0, beq - jmp))
             return JS_FALSE;
         ok = PopStatementBCE(cx, bce);
         break;
 
-      case PNK_DO:
+      case PNK_DOWHILE:
         /* Emit an annotated nop so we know to decompile a 'do' keyword. */
         noteIndex = NewSrcNote(cx, bce, SRC_WHILE);
         if (noteIndex < 0 || Emit1(cx, bce, JSOP_NOP) < 0)
             return JS_FALSE;
 
         noteIndex2 = NewSrcNote(cx, bce, SRC_TRACE);
         if (noteIndex2 < 0)
             return JS_FALSE;
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -496,17 +496,17 @@ js::FoldConstants(JSContext *cx, ParseNo
             if (!FoldConstants(cx, pn2, tc, inCond))
                 return false;
             break;
         }
 
         /* First kid may be null (for default case in switch). */
         if (pn1 && !FoldConstants(cx, pn1, tc, pn->isKind(PNK_WHILE)))
             return false;
-        if (!FoldConstants(cx, pn2, tc, pn->isKind(PNK_DO)))
+        if (!FoldConstants(cx, pn2, tc, pn->isKind(PNK_DOWHILE)))
             return false;
         break;
 
       case PN_UNARY:
         pn1 = pn->pn_kid;
 
         /*
          * Kludge to deal with typeof expressions: because constant folding
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -94,17 +94,17 @@ enum ParseNodeKind {
     PNK_THIS,
     PNK_FUNCTION,
     PNK_IF,
     PNK_ELSE,
     PNK_SWITCH,
     PNK_CASE,
     PNK_DEFAULT,
     PNK_WHILE,
-    PNK_DO,
+    PNK_DOWHILE,
     PNK_FOR,
     PNK_BREAK,
     PNK_CONTINUE,
     PNK_IN,
     PNK_VAR,
     PNK_WITH,
     PNK_RETURN,
     PNK_NEW,
@@ -236,17 +236,17 @@ enum ParseNodeKind {
  *                            PNK_LEXICALSCOPE node that contains the list of
  *                            PNK_CASE nodes.
  * PNK_CASE,    binary      pn_left: case expr
  *                          pn_right: PNK_LC node for this case's statements
  * PNK_DEFAULT  binary      pn_left: null
  *                          pn_right: PNK_LC node for this default's statements
  *                          pn_val: constant value if lookup or table switch
  * PNK_WHILE    binary      pn_left: cond, pn_right: body
- * PNK_DO       binary      pn_left: body, pn_right: cond
+ * PNK_DOWHILE  binary      pn_left: body, pn_right: cond
  * PNK_FOR      binary      pn_left: either PNK_FORIN (for-in statement) or
  *                            PNK_FORHEAD (for(;;) statement)
  *                          pn_right: body
  * PNK_FORIN    ternary     pn_kid1:  PNK_VAR to left of 'in', or NULL
  *                            its pn_xflags may have PNX_POPVAR
  *                            and PNX_FORINVAR bits set
  *                          pn_kid2: PNK_NAME or destructuring expr
  *                            to left of 'in'; if pn_kid1, then this
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -334,17 +334,17 @@ HasFinalReturn(ParseNode *pn)
       case PNK_WHILE:
         pn2 = pn->pn_left;
         if (pn2->isKind(PNK_TRUE))
             return ENDS_IN_RETURN;
         if (pn2->isKind(PNK_NUMBER) && pn2->pn_dval)
             return ENDS_IN_RETURN;
         return ENDS_IN_OTHER;
 
-      case PNK_DO:
+      case PNK_DOWHILE:
         pn2 = pn->pn_right;
         if (pn2->isKind(PNK_FALSE))
             return HasFinalReturn(pn->pn_left);
         if (pn2->isKind(PNK_TRUE))
             return ENDS_IN_RETURN;
         if (pn2->isKind(PNK_NUMBER)) {
             if (pn2->pn_dval == 0)
                 return HasFinalReturn(pn->pn_left);
@@ -3884,17 +3884,17 @@ Parser::statement()
         PopStatement(tc);
         pn->pn_pos.end = pn3->pn_pos.end;
         pn->pn_right = pn3;
         return pn;
       }
 
       case TOK_DO:
       {
-        pn = BinaryNode::create(PNK_DO, tc);
+        pn = BinaryNode::create(PNK_DOWHILE, tc);
         if (!pn)
             return NULL;
         StmtInfo stmtInfo;
         PushStatement(tc, &stmtInfo, STMT_DO_LOOP, -1);
         ParseNode *pn2 = statement();
         if (!pn2)
             return NULL;
         pn->pn_left = pn2;
--- a/js/src/jsreflect.cpp
+++ b/js/src/jsreflect.cpp
@@ -2141,17 +2141,17 @@ ASTSerializer::statement(ParseNode *pn, 
 
         return expression(pn->pn_left, &expr) &&
                statement(pn->pn_right, &stmt) &&
                (pn->isKind(PNK_WITH)
                 ? builder.withStatement(expr, stmt, &pn->pn_pos, dst)
                 : builder.whileStatement(expr, stmt, &pn->pn_pos, dst));
       }
 
-      case PNK_DO:
+      case PNK_DOWHILE:
       {
         Value stmt, test;
 
         return statement(pn->pn_left, &stmt) &&
                expression(pn->pn_right, &test) &&
                builder.doWhileStatement(stmt, test, &pn->pn_pos, dst);
       }