Bug 1166944 - Inline the only user of TraceObjectSlots; r=jonco

This commit is contained in:
Terrence Cole 2015-05-21 11:29:38 -07:00
parent 1ea581170f
commit 967c6efcdd
3 changed files with 5 additions and 18 deletions

View File

@ -528,18 +528,6 @@ js::TraceProcessGlobalRoot(JSTracer* trc, T* thing, const char* name)
template void js::TraceProcessGlobalRoot<JSAtom>(JSTracer*, JSAtom*, const char*);
template void js::TraceProcessGlobalRoot<JS::Symbol>(JSTracer*, JS::Symbol*, const char*);
void
js::TraceObjectSlots(JSTracer* trc, NativeObject* obj, uint32_t start, uint32_t nslots)
{
JS::AutoTracingIndex index(trc, start);
for (uint32_t i = start; i < (start + nslots); ++i) {
HeapSlot& slot = obj->getSlotRef(i);
if (InternalGCMethods<Value>::isMarkable(slot))
DispatchToTracer(trc, slot.unsafeGet(), "object slot");
++index;
}
}
// A typed functor adaptor for TraceRoot.
struct TraceRootFunctor {
template <typename T>

View File

@ -109,11 +109,6 @@ TraceGenericPointerRoot(JSTracer* trc, gc::Cell** thingp, const char* name);
void
TraceManuallyBarrieredGenericPointerEdge(JSTracer* trc, gc::Cell** thingp, const char* name);
// Object slots are not stored as a contiguous vector, so marking them as such
// will lead to the wrong indicies, if such are requested when tracing.
void
TraceObjectSlots(JSTracer* trc, NativeObject* obj, uint32_t start, uint32_t nslots);
// Depricated. Please use one of the strongly typed variants above.
void
TraceChildren(JSTracer* trc, void* thing, JSGCTraceKind kind);

View File

@ -4113,7 +4113,11 @@ JSObject::traceChildren(JSTracer* trc)
{
GetObjectSlotNameFunctor func(nobj);
JS::AutoTracingDetails ctx(trc, func);
TraceObjectSlots(trc, nobj, 0, nobj->slotSpan());
JS::AutoTracingIndex index(trc);
for (uint32_t i = 0; i < nobj->slotSpan(); ++i) {
TraceManuallyBarrieredEdge(trc, nobj->getSlotRef(i).unsafeGet(), "object slot");
++index;
}
}
do {