Bug 761504 - Remove FunctionBoxQueue. r=luke.

--HG--
extra : rebase_source : a29c928103bac3a22897ace27b7b47a1350adf4d
This commit is contained in:
Nicholas Nethercote 2012-06-04 23:08:10 -07:00
parent 8c7ce13920
commit a17b560818
2 changed files with 0 additions and 39 deletions

View File

@ -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__ */

View File

@ -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),