Bug 1842773 - Part 3: Add {FixedLength,Resizable}ArrayBufferObject classes. r=sfink
commit079493bcb37b09e5d9bdeb88a6b5d0032dd2387d
authorAndré Bargull <andre.bargull@gmail.com>
Thu, 25 Jan 2024 15:49:43 +0000 (25 15:49 +0000)
committerAndré Bargull <andre.bargull@gmail.com>
Thu, 25 Jan 2024 15:49:43 +0000 (25 15:49 +0000)
treef2a961f524c788d2a339c9de02472dc192830478
parentd4c7375c2df3b96c49d37aa019c64cba02cc397d
Bug 1842773 - Part 3: Add {FixedLength,Resizable}ArrayBufferObject classes. r=sfink

Change ArrayBufferObject into an abstract base class for the two new
classes `FixedLengthArrayBufferObject` and `ResizableArrayBufferObject`.

We need different classes, because resizable ArrayBuffers have slightly different
semantics and also need another reserved slot. Adding another reserved slot to
`ArrayBufferObject` changes the allocation kind from `AllocKind::ARRAYBUFFER4`
to `AllocKind::ARRAYBUFFER8`, which seems unfortunate for the common case of
non-resizable ArrayBuffers.

Differential Revision: https://phabricator.services.mozilla.com/D183319
15 files changed:
js/public/ProtoKey.h
js/public/experimental/TypedData.h
js/src/jit/CacheIR.cpp
js/src/jit/CacheIR.h
js/src/jit/CacheIRCompiler.cpp
js/src/jit/CacheIRGenerator.h
js/src/jit/CodeGenerator.cpp
js/src/jit/InlinableNatives.cpp
js/src/jit/WarpCacheIRTranspiler.cpp
js/src/vm/ArrayBufferObject-inl.h
js/src/vm/ArrayBufferObject.cpp
js/src/vm/ArrayBufferObject.h
js/src/vm/ArrayBufferViewObject.cpp
js/src/vm/JSObject-inl.h
js/src/vm/PortableBaselineInterpret.cpp