From a4975e4ccc1c32f49792795e9031829c7cbf70ff Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 4 Jun 2012 23:08:10 -0700 Subject: [PATCH] Bug 761504 - Remove FunctionBoxQueue. r=luke. --HG-- extra : rebase_source : a29c928103bac3a22897ace27b7b47a1350adf4d --- js/src/frontend/ParseNode.h | 38 ------------------------------------- js/src/frontend/Parser.cpp | 1 - 2 files changed, 39 deletions(-) diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index e48010d1f0d3..efb3e5c496c0 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -1512,7 +1512,6 @@ struct FunctionBox : public ObjectBox Bindings bindings; /* bindings for this function */ uint32_t level:JSFB_LEVEL_BITS; uint16_t ndefaults; - bool queued:1; bool inLoop:1; /* in a loop in parent function */ bool inWith:1; /* some enclosing scope is a with-statement or E4X filter-expression */ @@ -1537,43 +1536,6 @@ struct FunctionBox : public ObjectBox bool inAnyDynamicScope() const; }; -struct FunctionBoxQueue { - FunctionBox **vector; - size_t head, tail; - size_t lengthMask; - - size_t count() { return head - tail; } - size_t length() { return lengthMask + 1; } - - FunctionBoxQueue() - : vector(NULL), head(0), tail(0), lengthMask(0) { } - - bool init(uint32_t count) { - lengthMask = JS_BITMASK(JS_CEILING_LOG2W(count)); - vector = (FunctionBox **) OffTheBooks::malloc_(sizeof(FunctionBox) * length()); - return !!vector; - } - - ~FunctionBoxQueue() { UnwantedForeground::free_(vector); } - - void push(FunctionBox *funbox) { - if (!funbox->queued) { - JS_ASSERT(count() < length()); - vector[head++ & lengthMask] = funbox; - funbox->queued = true; - } - } - - FunctionBox *pull() { - if (tail == head) - return NULL; - JS_ASSERT(tail < head); - FunctionBox *funbox = vector[tail++ & lengthMask]; - funbox->queued = false; - return funbox; - } -}; - } /* namespace js */ #endif /* ParseNode_h__ */ diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 31d132758ec9..21b5f99886b8 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -179,7 +179,6 @@ FunctionBox::FunctionBox(ObjectBox* traceListHead, JSObject *obj, ParseNode *fn, bindings(tc->sc->context), level(tc->sc->staticLevel), ndefaults(0), - queued(false), inLoop(false), inWith(!!tc->innermostWith), inGenexpLambda(false),