Closed Bug 1842555 Opened 2 years ago Closed 2 years ago

Clean-up some TypedArray and ArrayBuffer code in preparation for resizable ArrayBuffers

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(14 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Various clean-ups TypedArray and ArrayBuffer code split from a patch stack for resizable ArrayBuffers (bug 1670026), which can be applied independently from the actual resizable ArrayBuffer patches.

The TypedArray class pointers are already not publicly visible. Resizable
ArrayBuffers will likely lead to adding different ArrayBuffer/DataView classes,
so there's a possibility there won't actually be a single ArrayBuffer/DataView
class.

Depends on D183118

Instead of manually initliasing the reserved slots, directly call initialize().

Depends on D183119

This matches the approach used for ArrayBuffers/SharedArrayBuffers and also
makes adding a separate DataView class for resizable ArrayBuffers easier.

Depends on D183120

SetFromNonTypedArray is no longer self-hosted.

Depends on D183121

PossiblyWrappedTypedArrayLength is inlined with CacheOp::GuardIsNotProxy,
which means an additional check for proxies, but MGuardIsNotProxy::foldsTo()
should make sure this extra check is optimised away.

Depends on D183122

ElementSpecific::setFromTypedArray can fail for different type TypedArrays
which use the same buffer, see ElementSpecific::setFromOverlappingTypedArray.

Depends on D183123

This check was added when the inputs were still uint32_t values. It can no
longer fail with the current types, so we can replace the runtime check with
an assertion.

Depends on D183124

Deallocation no longer reads SharedArrayRawBuffer::length_, which makes this
assertion unnecessary resp. its corresponding commment confusing.

Depends on D183125

Similar to part 2, CreateWasmBuffer can also be changed to directly return a
pointer value.

Depends on D183128

Blocks: 1842773
Severity: -- → N/A
Priority: -- → P3
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/8392f3e71013 Part 1: Remove no longer valid TypedObject references in comments. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/b638d6f78c72 Part 2: Avoid unnecessary handles when growing Wasm ArrayBuffers. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/fed442d7b21a Part 3: Inline ArrayBufferObject::initializeToInlineData() into its single caller. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/06178554576b Part 4: Make class pointer private members in TypedData header. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/10e3ba089358 Part 5: Use initialize method in createFromNewRawBuffer. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/4adee8eb1a43 Part 6: Replace DataView::is with IsDataView function. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/9e4f3967a0cf Part 7: Remove an out-dated comment about self-hosted SetFromNonTypedArray. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/bff4053321d3 Part 8: Prefer PossiblyWrappedTypedArrayLength. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/289c376a3cc2 Part 9: Add missing OOM handling. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/09514d7d99ae Part 10: Replace a check with an assertion. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/096244e162dd Part 11: Remove an assertion which is no longer needed. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/d10d8b5c0929 Part 12: Remove deprecated typedefs for ArrayBuffer and ArrayBufferMaybeShared. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/44e07dc07d34 Part 13: Remove deprecated typedefs for SharedArrayBuffer. r=spidermonkey-reviewers,jandem https://hg.mozilla.org/integration/autoland/rev/5878389d049f Part 14: Return pointer from CreateWasmBuffer. r=spidermonkey-reviewers,jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: