Change ArrayBuffer{View} offset/length accessors to return a wrapped size_t
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox84 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
Attachments
(10 files)
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
Bug 1673604 makes it possible for the slots to contain values larger than INT32_MAX, but many places dealing with array buffers/views are still using uint32_t or make similar assumptions about the maximum value.
Goal for this bug is to add a class that wraps a size_t and has two methods: get() that just returns the value (for callers that don't need any work) and deprecatedGetUint32 that asserts the value fits in an int32_t (for callers that need to be fixed or audited still). We can then return that from the length/offset accessors to mark the places that still need work.
Comment 1•5 years ago
|
||
It would be best if you keep changes in wasm/ separate, as I have another patch there.
| Assignee | ||
Comment 2•5 years ago
|
||
(In reply to Lars T Hansen [:lth] from comment #1)
It would be best if you keep changes in wasm/ separate, as I have another patch there.
Sorry I can't easily separate this, I'm touching every caller of byteLength() etc because the return type changes...
Comment 3•5 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #2)
(In reply to Lars T Hansen [:lth] from comment #1)
It would be best if you keep changes in wasm/ separate, as I have another patch there.
Sorry I can't easily separate this, I'm touching every caller of
byteLength()etc because the return type changes...
Be that as it may, those changes can't land... I guess it's a discussion for another day.
Comment 4•5 years ago
|
||
I guess what I should say is, I will probably land my patch tomorrow and at that point the places you need to update will have changed (and will all have moved into the API layer in WasmJS.cpp, and there will be fewer).
| Assignee | ||
Comment 5•5 years ago
|
||
We chatted about this. The Wasm patch will land soon, I can just rebase over that.
| Assignee | ||
Comment 6•5 years ago
|
||
Note that the argument changes from uint32_t to uint64_t because that's what the
new caller has.
| Assignee | ||
Comment 7•5 years ago
|
||
Depends on D95282
| Assignee | ||
Comment 8•5 years ago
|
||
Delete an unused overload. Remove the offset argument from the other.
Depends on D95283
| Assignee | ||
Comment 9•5 years ago
|
||
Most places use the deprecatedGetUint32 method so it's clear they still need to be
audited, tested and/or converted.
Depends on D95284
| Assignee | ||
Comment 10•5 years ago
|
||
Depends on D95285
| Assignee | ||
Comment 11•5 years ago
|
||
Note that get() is used in a few places where we know the data is stored inline
in the object so can't be very large.
Depends on D95286
| Assignee | ||
Comment 12•5 years ago
|
||
Depends on D95287
| Assignee | ||
Comment 13•5 years ago
|
||
Depends on D95288
| Assignee | ||
Comment 14•5 years ago
|
||
Depends on D95289
| Assignee | ||
Comment 15•5 years ago
|
||
The previous patch changed maybeCreateArrayBuffer to take uint64_t instead of
uint32_t so we no longer have to guard against uint32_t overflow first.
Depends on D95290
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b0ce1bd55470
https://hg.mozilla.org/mozilla-central/rev/90c6caf4d55f
https://hg.mozilla.org/mozilla-central/rev/39eaaa0f1dc8
https://hg.mozilla.org/mozilla-central/rev/a41ca50a7bac
https://hg.mozilla.org/mozilla-central/rev/70220d6a4792
https://hg.mozilla.org/mozilla-central/rev/0774accaf945
https://hg.mozilla.org/mozilla-central/rev/a637c801470b
https://hg.mozilla.org/mozilla-central/rev/19108edf0f70
https://hg.mozilla.org/mozilla-central/rev/487d37f789a2
https://hg.mozilla.org/mozilla-central/rev/afc5cf162b5a
Description
•