Lines Matching refs:ArrayBufferObject

140 bool js::ArrayBufferObject::supportLargeBuffers = true;
145 if (MOZ_UNLIKELY(nbytes > ArrayBufferObject::maxBufferByteLength())) { in CheckArrayBufferTooLarge()
323 ArrayBufferObject::finalize, // finalize
331 JS_FN("isView", ArrayBufferObject::fun_isView, 1, 0), JS_FS_END};
340 JS_PSG("byteLength", ArrayBufferObject::byteLengthGetter, 0),
344 GenericCreateConstructor<ArrayBufferObject::class_constructor, 1,
346 GenericCreatePrototype<ArrayBufferObject>,
353 ArrayBufferObject::objectMoved, // objectMovedOp
356 const JSClass ArrayBufferObject::class_ = {
365 const JSClass ArrayBufferObject::protoClass_ = {
370 return v.isObject() && v.toObject().is<ArrayBufferObject>(); in IsArrayBuffer()
373 MOZ_ALWAYS_INLINE bool ArrayBufferObject::byteLengthGetterImpl( in byteLengthGetterImpl()
376 auto* buffer = &args.thisv().toObject().as<ArrayBufferObject>(); in byteLengthGetterImpl()
381 bool ArrayBufferObject::byteLengthGetter(JSContext* cx, unsigned argc, in byteLengthGetter()
390 bool ArrayBufferObject::fun_isView(JSContext* cx, unsigned argc, Value* vp) { in fun_isView()
398 bool ArrayBufferObject::class_constructor(JSContext* cx, unsigned argc, in class_constructor()
474 JSContext* cx, Handle<ArrayBufferObject*> buffer) { in NewCopiedBufferContents()
486 void ArrayBufferObject::detach(JSContext* cx, in detach()
487 Handle<ArrayBufferObject*> buffer) { in detach()
730 WasmArrayRawBuffer* ArrayBufferObject::BufferContents::wasmBuffer() const { in wasmBuffer()
863 return CreateSpecificWasmBuffer<ArrayBufferObject, WasmArrayRawBuffer>( in CreateWasmBuffer()
867 bool ArrayBufferObject::prepareForAsmJS() { in prepareForAsmJS()
913 ArrayBufferObject::BufferContents ArrayBufferObject::createMappedContents( in createMappedContents()
920 uint8_t* ArrayBufferObject::inlineDataPointer() const { in inlineDataPointer()
924 uint8_t* ArrayBufferObject::dataPointer() const { in dataPointer()
928 SharedMem<uint8_t*> ArrayBufferObject::dataPointerShared() const { in dataPointerShared()
932 ArrayBufferObject::FreeInfo* ArrayBufferObject::freeInfo() const { in freeInfo()
937 void ArrayBufferObject::releaseData(JSFreeOp* fop) { in releaseData()
978 void ArrayBufferObject::setDataPointer(BufferContents contents) { in setDataPointer()
989 size_t ArrayBufferObject::byteLength() const { in byteLength()
993 inline size_t ArrayBufferObject::associatedBytes() const { in associatedBytes()
1003 void ArrayBufferObject::setByteLength(size_t length) { in setByteLength()
1008 size_t ArrayBufferObject::wasmMappedSize() const { in wasmMappedSize()
1015 IndexType ArrayBufferObject::wasmIndexType() const { in wasmIndexType()
1023 Pages ArrayBufferObject::wasmPages() const { in wasmPages()
1031 Pages ArrayBufferObject::wasmClampedMaxPages() const { in wasmClampedMaxPages()
1039 Maybe<Pages> ArrayBufferObject::wasmSourceMaxPages() const { in wasmSourceMaxPages()
1048 if (buf->is<ArrayBufferObject>()) { in WasmArrayBufferMappedSize()
1049 return buf->as<ArrayBufferObject>().wasmMappedSize(); in WasmArrayBufferMappedSize()
1056 if (buf->is<ArrayBufferObject>()) { in WasmArrayBufferIndexType()
1057 return buf->as<ArrayBufferObject>().wasmIndexType(); in WasmArrayBufferIndexType()
1062 if (buf->is<ArrayBufferObject>()) { in WasmArrayBufferPages()
1063 return buf->as<ArrayBufferObject>().wasmPages(); in WasmArrayBufferPages()
1069 if (buf->is<ArrayBufferObject>()) { in WasmArrayBufferClampedMaxPages()
1070 return buf->as<ArrayBufferObject>().wasmClampedMaxPages(); in WasmArrayBufferClampedMaxPages()
1076 if (buf->is<ArrayBufferObject>()) { in WasmArrayBufferSourceMaxPages()
1077 return buf->as<ArrayBufferObject>().wasmSourceMaxPages(); in WasmArrayBufferSourceMaxPages()
1082 static void CheckStealPreconditions(Handle<ArrayBufferObject*> buffer, in CheckStealPreconditions()
1092 bool ArrayBufferObject::wasmGrowToPagesInPlace( in wasmGrowToPagesInPlace()
1106 newPages.byteLength() <= ArrayBufferObject::maxBufferByteLength()); in wasmGrowToPagesInPlace()
1117 newBuf.set(ArrayBufferObject::createEmpty(cx)); in wasmGrowToPagesInPlace()
1138 ArrayBufferObject::detach(cx, oldBuf); in wasmGrowToPagesInPlace()
1148 bool ArrayBufferObject::wasmMovingGrowToPages( in wasmMovingGrowToPages()
1161 newPages.byteLength() < ArrayBufferObject::maxBufferByteLength()); in wasmMovingGrowToPages()
1172 newBuf.set(ArrayBufferObject::createEmpty(cx)); in wasmMovingGrowToPages()
1193 ArrayBufferObject::detach(cx, oldBuf); in wasmMovingGrowToPages()
1197 uint32_t ArrayBufferObject::flags() const { in flags()
1201 void ArrayBufferObject::setFlags(uint32_t flags) { in setFlags()
1218 static ArrayBufferObject* NewArrayBufferObject(JSContext* cx, in NewArrayBufferObject()
1234 const JSClass* clasp = &ArrayBufferObject::class_; in NewArrayBufferObject()
1239 constexpr size_t nfixed = ArrayBufferObject::RESERVED_SLOTS; in NewArrayBufferObject()
1259 return &obj->as<ArrayBufferObject>(); in NewArrayBufferObject()
1264 static ArrayBufferObject* NewArrayBufferObject(JSContext* cx) { in NewArrayBufferObject()
1265 static_assert(ArrayBufferObject::RESERVED_SLOTS == 4); in NewArrayBufferObject()
1269 ArrayBufferObject* ArrayBufferObject::createForContents( in createForContents()
1284 constexpr size_t reservedSlots = ArrayBufferObject::RESERVED_SLOTS; in createForContents()
1311 Rooted<ArrayBufferObject*> buffer( in createForContents()
1330 template <ArrayBufferObject::FillContents FillType>
1331 /* static */ std::tuple<ArrayBufferObject*, uint8_t*>
1332 ArrayBufferObject::createBufferAndData( in createBufferAndData()
1335 MOZ_ASSERT(nbytes <= ArrayBufferObject::maxBufferByteLength(), in createBufferAndData()
1341 size_t nslots = ArrayBufferObject::RESERVED_SLOTS; in createBufferAndData()
1359 ArrayBufferObject* buffer = NewArrayBufferObject(cx, proto, allocKind); in createBufferAndData()
1383 /* static */ ArrayBufferObject* ArrayBufferObject::copy( in copy()
1384 JSContext* cx, JS::Handle<ArrayBufferObject*> unwrappedArrayBuffer) { in copy()
1405 ArrayBufferObject* ArrayBufferObject::createZeroed( in createZeroed()
1419 ArrayBufferObject* ArrayBufferObject::createEmpty(JSContext* cx) { in createEmpty()
1421 ArrayBufferObject* obj = NewArrayBufferObject(cx); in createEmpty()
1430 ArrayBufferObject* ArrayBufferObject::createFromNewRawBuffer( in createFromNewRawBuffer()
1433 ArrayBufferObject* buffer = NewArrayBufferObject(cx); in createFromNewRawBuffer()
1453 /* static */ uint8_t* ArrayBufferObject::stealMallocedContents( in stealMallocedContents()
1454 JSContext* cx, Handle<ArrayBufferObject*> buffer) { in stealMallocedContents()
1470 ArrayBufferObject::detach(cx, buffer); in stealMallocedContents()
1487 ArrayBufferObject::detach(cx, buffer); in stealMallocedContents()
1507 /* static */ ArrayBufferObject::BufferContents
1508 ArrayBufferObject::extractStructuredCloneContents( in extractStructuredCloneContents()
1509 JSContext* cx, Handle<ArrayBufferObject*> buffer) { in extractStructuredCloneContents()
1523 ArrayBufferObject::detach(cx, buffer); in extractStructuredCloneContents()
1538 ArrayBufferObject::detach(cx, buffer); in extractStructuredCloneContents()
1563 void ArrayBufferObject::addSizeOfExcludingThis( in addSizeOfExcludingThis()
1566 auto& buffer = obj->as<ArrayBufferObject>(); in addSizeOfExcludingThis()
1611 void ArrayBufferObject::finalize(JSFreeOp* fop, JSObject* obj) { in finalize()
1612 obj->as<ArrayBufferObject>().releaseData(fop); in finalize()
1616 void ArrayBufferObject::copyData(Handle<ArrayBufferObject*> toBuffer, in copyData()
1618 Handle<ArrayBufferObject*> fromBuffer, in copyData()
1630 size_t ArrayBufferObject::objectMoved(JSObject* obj, JSObject* old) { in objectMoved()
1631 ArrayBufferObject& dst = obj->as<ArrayBufferObject>(); in objectMoved()
1632 const ArrayBufferObject& src = old->as<ArrayBufferObject>(); in objectMoved()
1642 JSObject* ArrayBufferObject::firstView() { in firstView()
1648 void ArrayBufferObject::setFirstView(ArrayBufferViewObject* view) { in setFirstView()
1652 bool ArrayBufferObject::addView(JSContext* cx, ArrayBufferViewObject* view) { in addView()
1667 bool InnerViewTable::addView(JSContext* cx, ArrayBufferObject* buffer, in addView()
1719 ArrayBufferObject* buffer) { in maybeViewsUnbarriered()
1727 void InnerViewTable::removeViews(ArrayBufferObject* buffer) { in removeViews()
1769 return is<ArrayBufferObject>() || is<SharedArrayBufferObject>(); in is()
1773 ArrayBufferObject* aobj = obj->maybeUnwrapAs<ArrayBufferObject>(); in GetArrayBufferByteLength()
1780 ArrayBufferObject* aobj = obj->maybeUnwrapIf<ArrayBufferObject>(); in GetArrayBufferData()
1788 static ArrayBufferObject* UnwrapOrReportArrayBuffer( in UnwrapOrReportArrayBuffer()
1796 if (!obj->is<ArrayBufferObject>()) { in UnwrapOrReportArrayBuffer()
1802 return &obj->as<ArrayBufferObject>(); in UnwrapOrReportArrayBuffer()
1810 Rooted<ArrayBufferObject*> unwrappedBuffer( in DetachArrayBuffer()
1823 ArrayBufferObject::detach(cx, unwrappedBuffer); in DetachArrayBuffer()
1830 Rooted<ArrayBufferObject*> unwrappedBuffer( in HasDefinedArrayBufferDetachKey()
1844 ArrayBufferObject* aobj = obj->maybeUnwrapIf<ArrayBufferObject>(); in IsDetachedArrayBufferObject()
1856 return ArrayBufferObject::createZeroed(cx, nbytes); in NewArrayBuffer()
1868 return ArrayBufferObject::createZeroed(cx, 0); in NewArrayBufferWithContents()
1871 using BufferContents = ArrayBufferObject::BufferContents; in NewArrayBufferWithContents()
1874 return ArrayBufferObject::createForContents(cx, nbytes, contents); in NewArrayBufferWithContents()
1884 Rooted<ArrayBufferObject*> unwrappedSource( in CopyArrayBuffer()
1890 return ArrayBufferObject::copy(cx, unwrappedSource); in CopyArrayBuffer()
1902 using BufferContents = ArrayBufferObject::BufferContents; in NewExternalArrayBuffer()
1906 return ArrayBufferObject::createForContents(cx, nbytes, contents); in NewExternalArrayBuffer()
1917 using BufferContents = ArrayBufferObject::BufferContents; in NewArrayBufferWithUserOwnedContents()
1920 return ArrayBufferObject::createForContents(cx, nbytes, contents); in NewArrayBufferWithUserOwnedContents()
1924 return obj->canUnwrapAs<ArrayBufferObject>(); in IsArrayBufferObject()
1928 return !obj->unwrapAs<ArrayBufferObject>().isDetached(); in ArrayBufferHasData()
1932 return obj->maybeUnwrapIf<ArrayBufferObject>(); in UnwrapArrayBuffer()
1945 Rooted<ArrayBufferObject*> unwrappedBuffer( in StealArrayBufferContents()
1964 return ArrayBufferObject::stealMallocedContents(cx, unwrappedBuffer); in StealArrayBufferContents()
1968 ArrayBufferObject::supportLargeBuffers = enable; in SetLargeArrayBuffersEnabled()
1979 using BufferContents = ArrayBufferObject::BufferContents; in NewMappedArrayBufferWithContents()
1982 return ArrayBufferObject::createForContents(cx, nbytes, contents); in NewMappedArrayBufferWithContents()
1987 return ArrayBufferObject::createMappedContents(fd, offset, length).data(); in CreateMappedArrayBufferContents()
1996 ArrayBufferObject* aobj = obj->maybeUnwrapIf<ArrayBufferObject>(); in IsMappedArrayBufferObject()
2007 ArrayBufferObject* aobj = obj->maybeUnwrapIf<ArrayBufferObject>(); in GetObjectAsArrayBuffer()
2022 auto& aobj = obj->as<ArrayBufferObject>(); in GetArrayBufferLengthAndData()
2029 &ArrayBufferObject::class_;
2037 return JS::ArrayBuffer(ArrayBufferObject::createZeroed(cx, nbytes)); in create()
2052 return buffer->as<ArrayBufferObject>().dataPointer(); in getLengthAndData()
2091 if (unwrappedToBlock->is<ArrayBufferObject>() && in ArrayBufferCopyData()
2092 unwrappedFromBlock->is<ArrayBufferObject>()) { in ArrayBufferCopyData()
2093 Rooted<ArrayBufferObject*> toArray( in ArrayBufferCopyData()
2094 cx, &unwrappedToBlock->as<ArrayBufferObject>()); in ArrayBufferCopyData()
2095 Rooted<ArrayBufferObject*> fromArray( in ArrayBufferCopyData()
2096 cx, &unwrappedFromBlock->as<ArrayBufferObject>()); in ArrayBufferCopyData()
2097 ArrayBufferObject::copyData(toArray, toIndex, fromArray, fromIndex, count); in ArrayBufferCopyData()