Bug 784608 (part 1) - Remove FunctionBox::inLoop. r=jimb.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 21 Aug 2012 23:55:51 -0700
changeset 105537 49c35b696124cf5fed13aebd79492dd02127d61b
parent 105534 74666a1eb791ef2b4447c442556017cc86e59544
child 105538 fdc5717ca867d86c5bcd32a897a33f5a342ee867
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersjimb
bugs784608
milestone17.0a1
Bug 784608 (part 1) - Remove FunctionBox::inLoop. r=jimb.
js/src/frontend/Parser.cpp
js/src/frontend/SharedContext.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -395,28 +395,21 @@ FunctionBox::FunctionBox(ObjectBox* trac
     kids(NULL),
     parent(pc->sc->inFunction() ? pc->sc->funbox() : NULL),
     bindings(),
     bufStart(0),
     bufEnd(0),
     level(pc->staticLevel),
     ndefaults(0),
     strictModeState(sms),
-    inLoop(false),
     inWith(!!pc->innermostWith),
     inGenexpLambda(false),
     cxFlags(pc->sc->context)     // the cxFlags are set in LeaveFunction
 {
     isFunctionBox = true;
-    for (StmtInfoPC *stmt = pc->topStmt; stmt; stmt = stmt->down) {
-        if (stmt->isLoop()) {
-            inLoop = true;
-            break;
-        }
-    }
     if (!pc->sc->inFunction()) {
         JSObject *scope = pc->sc->scopeChain();
         while (scope) {
             if (scope->isWith())
                 inWith = true;
             scope = scope->enclosingScope();
         }
     }
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -296,17 +296,16 @@ struct FunctionBox : public ObjectBox
     FunctionBox     *kids;
     FunctionBox     *parent;
     Bindings        bindings;               /* bindings for this function */
     size_t          bufStart;
     size_t          bufEnd;
     uint16_t        level;
     uint16_t        ndefaults;
     StrictMode::StrictModeState strictModeState;
-    bool            inLoop:1;               /* in a loop in parent function */
     bool            inWith:1;               /* some enclosing scope is a with-statement
                                                or E4X filter-expression */
     bool            inGenexpLambda:1;       /* lambda from generator expression */
 
     ContextFlags    cxFlags;
 
     FunctionBox(ObjectBox* traceListHead, JSObject *obj, ParseNode *fn, ParseContext *pc,
                 StrictMode::StrictModeState sms);