Bug 899827 - Allow AutoObjectObjectHashMap to store Nursery GC things; r=jonco

--HG--
extra : rebase_source : 9c528adf006c021fb519013f3265edfa10803714
This commit is contained in:
Terrence Cole 2013-07-30 16:18:46 -07:00
parent 93a57a5bf7
commit 0310984563

View File

@ -482,10 +482,12 @@ AutoGCRooter::trace(JSTracer *trc)
case OBJOBJHASHMAP: {
AutoObjectObjectHashMap::HashMapImpl &map = static_cast<AutoObjectObjectHashMap *>(this)->map;
for (AutoObjectObjectHashMap::Enum e(map); !e.empty(); e.popFront()) {
mozilla::DebugOnly<JSObject *> key = e.front().key;
MarkObjectRoot(trc, const_cast<JSObject **>(&e.front().key), "AutoObjectObjectHashMap key");
JS_ASSERT(key == e.front().key); // Needs rewriting for moving GC, see bug 726687.
MarkObjectRoot(trc, &e.front().value, "AutoObjectObjectHashMap value");
JS_SET_TRACING_LOCATION(trc, (void *)&e.front().key);
JSObject *key = e.front().key;
MarkObjectRoot(trc, &key, "AutoObjectObjectHashMap key");
if (key != e.front().key)
e.rekeyFront(key);
}
return;
}