зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1290034 - Ensure nursery allocations are correctly aligned r=terrence
This commit is contained in:
Родитель
8e2dedbc9f
Коммит
2bcd075f28
|
@ -253,6 +253,8 @@ js::Nursery::allocate(size_t size)
|
|||
MOZ_ASSERT(isEnabled());
|
||||
MOZ_ASSERT(!runtime()->isHeapBusy());
|
||||
MOZ_ASSERT(position() >= currentStart_);
|
||||
MOZ_ASSERT(position() % gc::CellSize == 0);
|
||||
MOZ_ASSERT(size % gc::CellSize == 0);
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
static const size_t CanarySize = (sizeof(Nursery::Canary) + CellSize - 1) & ~CellMask;
|
||||
|
|
|
@ -781,6 +781,7 @@ MacroAssembler::nurseryAllocate(Register result, Register temp, gc::AllocKind al
|
|||
const Nursery& nursery = GetJitContext()->runtime->gcNursery();
|
||||
int thingSize = int(gc::Arena::thingSize(allocKind));
|
||||
int totalSize = thingSize + nDynamicSlots * sizeof(HeapSlot);
|
||||
MOZ_ASSERT(totalSize % gc::CellSize == 0);
|
||||
loadPtr(AbsoluteAddress(nursery.addressOfPosition()), result);
|
||||
computeEffectiveAddress(Address(result, totalSize), temp);
|
||||
branchPtr(Assembler::Below, AbsoluteAddress(nursery.addressOfCurrentEnd()), temp, fail);
|
||||
|
|
Загрузка…
Ссылка в новой задаче