Closed Bug 1704042 Opened 3 years ago Closed 3 years ago

Remove the GetLengthProperty overload that returns uint32_t

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(9 files)

(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details

Lars noticed this causing problems for some tests.

Summary: Remove the GetLengthProperty override that returns uint32_t → Remove the GetLengthProperty overload that returns uint32_t

These clamp to or check for ARGS_LENGTH_MAX so there's no change in behavior.

Depends on D111381

These functions aren't available to content and we don't want to support
large lengths there, so just report an exception.

Depends on D111382

This is always an ArrayObject, so get its length() directly.

Depends on D111386

There are a number of callers in Gecko, most of them are using to iterate over an object
expected to be an array. This should be okay for now; if there are callers that need the
full length we can add a separate API that returns uint64_t.

This lets us remove ToLengthClamped and the GetLengthProperty overload returning uint32_t.

Depends on D111388

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/93d64ac021f9
part 1 - Make GetLengthProperty overload returning uint64_t available outside Array.cpp. r=lth
https://hg.mozilla.org/integration/autoland/rev/3458449ccb39
part 2 - Use GetLengthProperty overload returning uint64_t for function calls. r=lth
https://hg.mozilla.org/integration/autoland/rev/ad3456e4f2bc
part 3 - Use GetLengthProperty overload returning uint64_t for some internal functions. r=lth
https://hg.mozilla.org/integration/autoland/rev/9d20ba60f0ee
part 4 - Use GetLengthProperty overload returning uint64_t for TypedArray fromObject. r=lth
https://hg.mozilla.org/integration/autoland/rev/57579fea8a65
part 5 - Use GetLengthProperty overload returning uint64_t for TypedArray set method. r=lth
https://hg.mozilla.org/integration/autoland/rev/bb0fc8f4bbac
part 6 - Use GetLengthProperty overload returning uint64_t for CreateFilteredListFromArrayLike. r=lth
https://hg.mozilla.org/integration/autoland/rev/91f155b2913f
part 7 - Use ArrayObject::length instead of GetLengthProperty for module namespace exports object. r=lth
https://hg.mozilla.org/integration/autoland/rev/6da24a2d6334
part 8 - Add GetLengthPropertyForArray to the JSON code. r=lth
https://hg.mozilla.org/integration/autoland/rev/79f3f364ed33
part 9 - Report an exception for large lengths from JS::GetArrayLength API. r=lth
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: