Fix various issues in the Change-Array-By-Copy functions
Categories
(Core :: JavaScript: Standard Library, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox105 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(15 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 | |
Bug 1783703 - Part 12: Inline NewDensePartlyAllocatedArray with uint64_t length argument. r=mgaudet!
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 |
Fix various issues in the Change-Array-By-Copy functions and add some optimisations for the C++ code.
Assignee | ||
Comment 1•3 years ago
|
||
There's already a realm creation option for this feature.
Depends on D153981
Assignee | ||
Comment 2•3 years ago
|
||
Built-ins are created when the realm is created (at least according to the spec),
so it should be a RealmCreationOptions.
Depends on D153982
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D153983
Assignee | ||
Comment 4•3 years ago
|
||
This function has been removed from the proposal.
Depends on D153984
Assignee | ||
Comment 5•3 years ago
|
||
Changes:
- Don't enter the compartment of the TypedArray to match TypedArraySort. This
is done to avoid having to switch the compartment when the comparator function
is in the current compartment. - Add missing check for detached buffers.
- Use single line comments, because we prefer them for new code.
- Avoid unnecessary indirection through
CallTypedArrayMethodIfWrapped
.
Depends on D153985
Assignee | ||
Comment 6•3 years ago
|
||
Drive-by change:
- Replace DefineDataProperty with assignment to better match spec.
Depends on D153986
Assignee | ||
Comment 7•3 years ago
|
||
Changes:
- Correctly check for detached buffers.
- Consistently use
var
. - Coerce
value
before the range check. - Reload
length
before range check. - Replace DefineDataProperty with assignment to match spec.
- Remove unused function
isValidIntegerIndex
Depends on D153987
Assignee | ||
Comment 8•3 years ago
|
||
Depends on D153988
Assignee | ||
Comment 9•3 years ago
|
||
Changes:
GetPrototypeFromBuiltinConstructor
is unnecessary.- Use
NewDensePartlyAllocatedArray
to better describe how the array is allocated. IsIntegralNumber
is unused.- More comment changes.
JSMSG_BAD_INDEX
doesn't have an argument string.int64_t(len + actualIndex)
is UB when the result is outside the int64_t range.- Add missing
CheckForInterrupt
. - Use
DefineArrayElement
instead ofSetArrayElement
. - Prefer variable name
arr
overA
to match other functions here and elsewhere in C++.
Depends on D153989
Assignee | ||
Comment 10•3 years ago
|
||
- Use correct types.
- Use single line comments, because we prefer them in new code.
- Add extra assertions.
Depends on D153990
Assignee | ||
Comment 11•3 years ago
|
||
Changes:
array_toSpliced
instead ofarray_to_spliced
to match naming conventions.- More comment changes.
- More assertions.
- Use more narrow types where possible.
- Add missing
CheckForInterrupt
. - Use
DefineArrayElement
instead ofSetArrayElement
to match spec.
Depends on D153991
Assignee | ||
Comment 12•3 years ago
|
||
Needed for later patches.
Depends on D153992
Assignee | ||
Comment 13•3 years ago
|
||
We should provide an optimisation for dense elements when the code is already
in C++.
Depends on D153993
Assignee | ||
Comment 14•3 years ago
|
||
We should provide an optimisation for dense elements when the code is already
in C++.
Depends on D153994
Assignee | ||
Comment 15•3 years ago
|
||
Depends on D153995
Comment 16•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 18•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/20bab21cb2f9
https://hg.mozilla.org/mozilla-central/rev/51f5e08c0910
https://hg.mozilla.org/mozilla-central/rev/756492ddc26e
https://hg.mozilla.org/mozilla-central/rev/cc68008df183
https://hg.mozilla.org/mozilla-central/rev/bf33097e583a
https://hg.mozilla.org/mozilla-central/rev/10e2bccd526b
https://hg.mozilla.org/mozilla-central/rev/a8624e35aca9
https://hg.mozilla.org/mozilla-central/rev/94f2ccf5ad44
https://hg.mozilla.org/mozilla-central/rev/62d7d9d37022
https://hg.mozilla.org/mozilla-central/rev/dd1820cfa903
https://hg.mozilla.org/mozilla-central/rev/b39a39e874ef
https://hg.mozilla.org/mozilla-central/rev/ede9a0e515ad
https://hg.mozilla.org/mozilla-central/rev/d3bb893d3ebe
https://hg.mozilla.org/mozilla-central/rev/c65668216e4e
https://hg.mozilla.org/mozilla-central/rev/e54f9ca5cb57
Updated•3 years ago
|
Description
•