Bug 768626 - Add rooting analysis for PropertyId; r=Waldo

--HG--
extra : rebase_source : 42ba66650effc95e7c764026e2e9c32a16b21838
This commit is contained in:
Terrence Cole 2012-06-26 13:42:39 -07:00
parent c69ecca54b
commit 8784cfa2dc
3 changed files with 13 additions and 0 deletions

View File

@ -879,6 +879,8 @@ MarkExactStackRoots(JSTracer *trc)
MarkStringRoot(trc, (JSString **)addr, "exact stackroot string");
} else if (i == THING_ROOT_ID) {
MarkIdRoot(trc, (jsid *)addr, "exact stackroot id");
} else if (i == THING_ROOT_PROPERTY_ID) {
MarkIdRoot(trc, ((PropertyId *)addr)->asId(), "exact stackroot property id");
} else if (i == THING_ROOT_VALUE) {
MarkValueRoot(trc, (Value *)addr, "exact stackroot value");
} else if (i == THING_ROOT_SHAPE) {

View File

@ -230,6 +230,7 @@ enum ThingRootKind
THING_ROOT_SCRIPT,
THING_ROOT_XML,
THING_ROOT_ID,
THING_ROOT_PROPERTY_ID,
THING_ROOT_VALUE,
THING_ROOT_LIMIT
};

View File

@ -1266,6 +1266,7 @@ class ObjectImpl : public gc::Cell
}
/* GC support. */
static inline ThingRootKind rootKind() { return THING_ROOT_OBJECT; }
static inline void readBarrier(ObjectImpl *obj);
static inline void writeBarrierPre(ObjectImpl *obj);
static inline void writeBarrierPost(ObjectImpl *obj, void *addr);
@ -1359,4 +1360,13 @@ HasElement(JSContext *cx, Handle<ObjectImpl*> obj, uint32_t index, unsigned reso
} /* namespace js */
namespace JS {
template <> struct RootMethods<js::PropertyId>
{
static js::PropertyId initial() { return js::PropertyId(); }
static ThingRootKind kind() { return THING_ROOT_PROPERTY_ID; }
static bool poisoned(js::PropertyId propid) { return IsPoisonedId(propid.asId()); }
};
}
#endif /* ObjectImpl_h__ */