Closed Bug 1686445 Opened 4 months ago Closed 4 months ago

Make structured cloning work with large array buffers

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(8 files)

This will need format changes for ArrayBuffer, TypedArray, DataView objects because it stores (some) length values as 32-bit integers. We still need to support reading the current format, so we also have to add tests for that.

I wrote some patches for this a few months ago that I just have to clean up.

This ensures we can still read this after we add the new V3 types.

Renames SCTAG_ARRAY_BUFFER_OBJECT to SCTAG_ARRAY_BUFFER_OBJECT_V2 and adds a new
SCTAG_ARRAY_BUFFER_OBJECT that encodes the length as 64-bit value.

Depends on D101734

Instead of storing the length in the 32-bit data and the array type separately as
64-bit value, the new version just switches those.

Depends on D101735

There are no backwards-compatibility concerns because SABs are only cloned within
the same process (checked in writeSharedArrayBuffer).

Depends on D101737

The length is encoded as 64-bit value (extraData) and used within the same process.

Depends on D101738

This prevents truncation in the structured clone code.

Depends on D101739

Attachment #9197056 - Attachment description: Bug 1686445 part 7 - Change some APIs to take size_t instead of int32_t/uint32_t. r?sfink! → Bug 1686445 part 7 - Change some APIs to take int64_t/size_t instead of int32_t/uint32_t. r?sfink!
Severity: normal → N/A
Priority: -- → P1
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eae09146c9f9
part 1 - Add structured clone tests for reading current array buffer format. r=sfink
https://hg.mozilla.org/integration/autoland/rev/fae906026e24
part 2 - Add structured clone support for large ArrayBuffers. r=sfink
https://hg.mozilla.org/integration/autoland/rev/ad251c4f6d76
part 3 - Add structured clone support for large TypedArrays. r=sfink
https://hg.mozilla.org/integration/autoland/rev/2ca9f9036962
part 4 - Add structured clone support for large DataViews. r=sfink
https://hg.mozilla.org/integration/autoland/rev/7f17f8fb1135
part 5 - Add structured clone support for large SharedArrayBuffers. r=sfink,lth
https://hg.mozilla.org/integration/autoland/rev/f7ac99e85da7
part 6 - Add structured clone support for transfering large ArrayBuffers. r=sfink
https://hg.mozilla.org/integration/autoland/rev/ea90adb7bf61
part 7 - Change some APIs to take int64_t/size_t instead of int32_t/uint32_t. r=sfink
https://hg.mozilla.org/integration/autoland/rev/d5154885d8d2
part 8 - Add tests for structured cloning large buffers. r=sfink
You need to log in before you can comment on or make changes to this bug.