mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 761504 - Remove FunctionBoxQueue. r=luke.
--HG-- extra : rebase_source : a29c928103bac3a22897ace27b7b47a1350adf4d
This commit is contained in:
parent
26d46956df
commit
a4975e4ccc
@ -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__ */
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user