зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1020290 - reduce the proliferation of names by introducing overloading. r=shu
This commit is contained in:
Родитель
9c46f5732d
Коммит
251f0161da
|
@ -481,10 +481,8 @@ typedef CompartmentsIterT<GCZoneGroupIter> GCCompartmentGroupIter;
|
|||
*/
|
||||
template <AllowGC allowGC>
|
||||
inline JSObject *
|
||||
TryNewNurseryObject(ThreadSafeContext *cxArg, size_t thingSize, size_t nDynamicSlots)
|
||||
TryNewNurseryObject(JSContext *cx, size_t thingSize, size_t nDynamicSlots)
|
||||
{
|
||||
JSContext *cx = cxArg->asJSContext();
|
||||
|
||||
JS_ASSERT(!IsAtomsCompartment(cx->compartment()));
|
||||
JSRuntime *rt = cx->runtime();
|
||||
Nursery &nursery = rt->gc.nursery;
|
||||
|
@ -508,7 +506,7 @@ TryNewNurseryObject(ThreadSafeContext *cxArg, size_t thingSize, size_t nDynamicS
|
|||
#ifdef JSGC_FJGENERATIONAL
|
||||
template <AllowGC allowGC>
|
||||
inline JSObject *
|
||||
TryNewFJNurseryObject(ForkJoinContext *cx, size_t thingSize, size_t nDynamicSlots)
|
||||
TryNewNurseryObject(ForkJoinContext *cx, size_t thingSize, size_t nDynamicSlots)
|
||||
{
|
||||
ForkJoinNursery &nursery = cx->nursery();
|
||||
bool tooLarge = false;
|
||||
|
@ -617,7 +615,7 @@ AllocateObject(ThreadSafeContext *cx, AllocKind kind, size_t nDynamicSlots, Init
|
|||
#ifdef JSGC_GENERATIONAL
|
||||
if (cx->isJSContext() &&
|
||||
ShouldNurseryAllocate(cx->asJSContext()->nursery(), kind, heap)) {
|
||||
JSObject *obj = TryNewNurseryObject<allowGC>(cx, thingSize, nDynamicSlots);
|
||||
JSObject *obj = TryNewNurseryObject<allowGC>(cx->asJSContext(), thingSize, nDynamicSlots);
|
||||
if (obj)
|
||||
return obj;
|
||||
}
|
||||
|
@ -627,7 +625,7 @@ AllocateObject(ThreadSafeContext *cx, AllocKind kind, size_t nDynamicSlots, Init
|
|||
ShouldFJNurseryAllocate(cx->asForkJoinContext()->nursery(), kind, heap))
|
||||
{
|
||||
JSObject *obj =
|
||||
TryNewFJNurseryObject<allowGC>(cx->asForkJoinContext(), thingSize, nDynamicSlots);
|
||||
TryNewNurseryObject<allowGC>(cx->asForkJoinContext(), thingSize, nDynamicSlots);
|
||||
if (obj)
|
||||
return obj;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче