Change OOB set for TypedArray target and different receiver
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox131 | --- | fixed |
People
(Reporter: yulia, Assigned: anba)
References
(Blocks 1 open bug, )
Details
Attachments
(7 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 |
We are currently the odd browser out for typed objects when setting out of bounds. We fall through to OrdinarySet where other browsers exit early. After discussion at tc39, it was decided to use the behavior shared by v8 and JSC
Comment 1•3 years ago
|
||
(Reading the PR I think this is typed arrays and not typed objects?)
Updated•1 year ago
|
Comment 3•1 year ago
|
||
See also duplicate bug 1913490
Assignee | ||
Comment 4•1 year ago
|
||
Drive-by changes:
- Make
SetPropertyByDefining
a filestatic
function. - Remove unused functions
SetPropertyOnProto
andPropertyResult::setWasmGcProperty
.
Updated•1 year ago
|
Assignee | ||
Comment 5•1 year ago
|
||
Instead of checking desc_.resolving()
repeatedly, move the check into the
outer if-statement.
Drive-by change:
- Remove some unnecessary re-rooting of already rooted variables.
Assignee | ||
Comment 6•1 year ago
|
||
ValidateAndApplyPropertyDescriptor
was refactored in https://github.com/tc39/ecma262/pull/2468,
make sure our implementation follows the current spec text more closely.
But also include the fix from https://github.com/tc39/ecma262/pull/3404.
Assignee | ||
Comment 7•1 year ago
|
||
We don't use AutoResolving::Kind::WATCH
anymore, so we can remove the
whole AutoResolving::Kind
enum.
Assignee | ||
Comment 8•1 year ago
|
||
It doesn't seem necessary to effectively inline SetTypedArrayElement
here.
Assignee | ||
Comment 9•1 year ago
|
||
SetTypedArrayElement
doesn't allow to be called with out-of-bounds indices and
SetTypedArrayElementOutOfBounds
must only be called with out-of-bounds indices.
Since we need to rerun the bounds check anyway in TypedArrayObjectTemplate::setElement
after calling convertValue
, it doesn't seem useful to have these two separate
functions. And using a single SetTypedArrayElement
function which allows out-of-bounds
indices also follows the spec more closely.
Assignee | ||
Comment 10•1 year ago
|
||
When SetNonexistentProperty
is called with out-of-bounds typed array indices, the
spec want us to call SetTypedArrayElement
only if the current object pobj
is the
receiver
.
Two changes are necessary to plumb the relevant information to SetNonexistentProperty
:
PropertyResult::ignoreProtoChain_
needs an additional bit to track out-of-bounds
typed array indices. We can store this extra bit efficiently by changingignoreProtoChain_
frombool
touint8_t
.- The current object
pobj
needs to be passed toSetNonexistentProperty
in addition to
obj
andreceiver
.
There's additional test coverage in test262, but we first need to update test262 again.
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8ae7bdf2f383
https://hg.mozilla.org/mozilla-central/rev/c24248022ef2
https://hg.mozilla.org/mozilla-central/rev/b15419ec07fa
https://hg.mozilla.org/mozilla-central/rev/1f084420eb9f
https://hg.mozilla.org/mozilla-central/rev/e5650c79587b
https://hg.mozilla.org/mozilla-central/rev/b086d0061631
https://hg.mozilla.org/mozilla-central/rev/e969f552745a
Description
•