Bug 1105069 - Part 4: Convert IsIncrementalReferenceBarrierNeededTenuredGCThing to GCCellPtr; r=jonco

--HG--
extra : rebase_source : b8b403745c98ec09e29340aa74a801bd633f0483
This commit is contained in:
Terrence Cole 2014-05-19 14:58:05 -07:00
Родитель 972aea62c7
Коммит 0adfbe6015
2 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -493,7 +493,7 @@ ExposeGCThingToActiveJS(JS::GCCellPtr thing)
if (IsInsideNursery(thing))
return;
#endif
if (JS::IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing, thing.kind()))
if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing))
JS::IncrementalReferenceBarrier(thing, thing.kind());
else if (JS::GCThingIsMarkedGray(thing))
JS::UnmarkGrayGCThingRecursively(thing, thing.kind());
@ -536,7 +536,7 @@ MarkGCThingAsLive(JSRuntime *rt_, void *thing, JSGCTraceKind kind)
if (js::gc::IsInsideNursery((js::gc::Cell *)thing))
return;
#endif
if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing, kind))
if (js::gc::IsIncrementalBarrierNeededOnTenuredGCThing(rt, GCCellPtr(thing, kind)))
IncrementalReferenceBarrier(thing, kind);
}

Просмотреть файл

@ -342,7 +342,6 @@ IsInsideNursery(const js::gc::Cell *cell)
}
} /* namespace gc */
} /* namespace js */
namespace JS {
@ -378,19 +377,25 @@ GCThingIsMarkedGray(void *thing)
return *word & mask;
}
} /* namespace JS */
namespace js {
namespace gc {
static MOZ_ALWAYS_INLINE bool
IsIncrementalBarrierNeededOnTenuredGCThing(shadow::Runtime *rt, void *thing, JSGCTraceKind kind)
IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime *rt, const JS::GCCellPtr thing)
{
MOZ_ASSERT(thing);
#ifdef JSGC_GENERATIONAL
MOZ_ASSERT(!js::gc::IsInsideNursery((js::gc::Cell *)thing));
MOZ_ASSERT(!js::gc::IsInsideNursery(thing));
#endif
if (!rt->needsIncrementalBarrier())
return false;
JS::Zone *zone = GetTenuredGCThingZone(thing);
return reinterpret_cast<shadow::Zone *>(zone)->needsIncrementalBarrier();
JS::Zone *zone = JS::GetTenuredGCThingZone(thing);
return JS::shadow::Zone::asShadowZone(zone)->needsIncrementalBarrier();
}
} /* namespace JS */
} /* namespace gc */
} /* namespace js */
#endif /* js_HeapAPI_h */