mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 673125: Provide stack-allocated vectors of JSObject pointers. r=luke.
This commit is contained in:
parent
fab58c0d9c
commit
3abd972834
@ -1482,7 +1482,8 @@ class AutoGCRooter {
|
||||
STRING = -14, /* js::AutoStringRooter */
|
||||
IDVECTOR = -15, /* js::AutoIdVector */
|
||||
BINDINGS = -16, /* js::Bindings */
|
||||
SHAPEVECTOR = -17 /* js::AutoShapeVector */
|
||||
SHAPEVECTOR = -17, /* js::AutoShapeVector */
|
||||
OBJVECTOR = -18 /* js::AutoObjectVector */
|
||||
};
|
||||
|
||||
private:
|
||||
@ -2487,6 +2488,19 @@ class AutoValueVector : public AutoVectorRooter<Value>
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
class AutoObjectVector : public AutoVectorRooter<JSObject *>
|
||||
{
|
||||
public:
|
||||
explicit AutoObjectVector(JSContext *cx
|
||||
JS_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: AutoVectorRooter<JSObject *>(cx, OBJVECTOR)
|
||||
{
|
||||
JS_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
}
|
||||
|
||||
JS_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
class AutoIdVector : public AutoVectorRooter<jsid>
|
||||
{
|
||||
public:
|
||||
|
@ -1784,6 +1784,12 @@ AutoGCRooter::trace(JSTracer *trc)
|
||||
static_cast<js::AutoBindingsRooter *>(this)->bindings.trace(trc);
|
||||
return;
|
||||
}
|
||||
|
||||
case OBJVECTOR: {
|
||||
AutoObjectVector::VectorImpl &vector = static_cast<AutoObjectVector *>(this)->vector;
|
||||
MarkObjectRange(trc, vector.length(), vector.begin(), "js::AutoObjectVector.vector");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
JS_ASSERT(tag >= 0);
|
||||
|
Loading…
Reference in New Issue
Block a user