Bug 1215337 - Cache slotSpan(), r=terrence

--HG--
extra : rebase_source : 30a1fa3398af0bf1aade4e1d7da469aa2aaf95ac
This commit is contained in:
Steve Fink 2015-10-15 15:45:51 -07:00
parent 7c7d0cb763
commit 4941565e3d

View File

@ -3713,11 +3713,15 @@ JSObject::traceChildren(JSTracer* trc)
GetObjectSlotNameFunctor func(nobj);
JS::AutoTracingDetails ctx(trc, func);
JS::AutoTracingIndex index(trc);
for (uint32_t i = 0; i < nobj->slotSpan(); ++i) {
// Tracing can mutate the target but cannot change the slot count,
// but the compiler has no way of knowing this.
const uint32_t nslots = nobj->slotSpan();
for (uint32_t i = 0; i < nslots; ++i) {
TraceManuallyBarrieredEdge(trc, nobj->getSlotRef(i).unsafeUnbarrieredForTracing(),
"object slot");
++index;
}
MOZ_ASSERT(nslots == nobj->slotSpan());
}
do {