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::copySlotRange(uint32_t start, const Value *vector, uint32_t length) { JS::Zone *zone = this->zone(); HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd; getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd); for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++) sp->set(zone, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++); for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++) sp->set(zone, this->asObjectPtr(), HeapSlot::Slot, start++, *vector++); }
void js::ObjectImpl::copySlotRange(uint32_t start, const Value *vector, uint32_t length) { JSCompartment *comp = compartment(); HeapSlot *fixedStart, *fixedEnd, *slotsStart, *slotsEnd; getSlotRange(start, length, &fixedStart, &fixedEnd, &slotsStart, &slotsEnd); for (HeapSlot *sp = fixedStart; sp < fixedEnd; sp++) sp->set(comp, this->asObjectPtr(), start++, *vector++); for (HeapSlot *sp = slotsStart; sp < slotsEnd; sp++) sp->set(comp, this->asObjectPtr(), 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()); }
MOZ_ALWAYS_INLINE void * StoreBuffer::SlotEdge::deref() const { HeapSlot *loc = slotLocation(); return (loc && loc->isGCThing()) ? loc->toGCThing() : nullptr; }