mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
Bug 1215337 - Cache slotSpan(), r=terrence
--HG-- extra : rebase_source : 30a1fa3398af0bf1aade4e1d7da469aa2aaf95ac
This commit is contained in:
parent
7c7d0cb763
commit
4941565e3d
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user