void js::ObjectImpl::initSlotRange(uint32_t start, const Value *vector, uint32_t length) { HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd; getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd); for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++) sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++); for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++) sp->init(this->asObjectPtr(), HeapSlot::Slot, start++, *vector++); }
void js::ObjectImpl::initializeSlotRange(uint32_t start, uint32_t length) { /* * No bounds check, as this is used when the object's shape does not * reflect its allocated slots (updateSlotsForSpan). */ HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd; getSlotRangeUnchecked(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd); uint32_t offset = start; for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++) sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue()); for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++) sp->init(this->asObjectPtr(), HeapSlot::Slot, offset++, UndefinedValue()); }