Basic Private Fields Support
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox80 | --- | fixed |
People
(Reporter: mgaudet, Assigned: mgaudet)
References
Details
Attachments
(17 files, 1 obsolete file)
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 | |
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 |
This bug will be used to land patches implementing basic private field support:
This means basic private field test cases will work, however, we won't pass everything on test262, nor will it include enabling all the JIT compilers. That will be left for another bug.
Assignee | ||
Comment 1•3 years ago
|
||
Matthew Gaudet- Added illegal-in-class-context to ensure that field syntax
only works inside of classes if fields are enabled.
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Assignee | ||
Comment 3•3 years ago
|
||
Matthew Gaudet: Add test for double declaration of private name
Assignee | ||
Comment 4•3 years ago
|
||
Matthew Gaudet - Added comment
Assignee | ||
Comment 5•3 years ago
|
||
Matthew Gaudet: Use NoteUsedName inside of fieldInitializerOpt rather than allocating a new PrivateName node.
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D74474
Assignee | ||
Comment 7•3 years ago
|
||
This code was previously unexercised, and so recent changes revealed this bug.
Depends on D77922
Assignee | ||
Comment 8•3 years ago
|
||
This patch allows access to private fields. Adds three new opcodes,
InitPrivateElem, GetPrivateElem, SetPrivateElem, specialized to the
requirements of private names (all three throw in some circumstances where
their non-private bretheren would proceed apace.)
This supports -no- compilers, which means that the test must be run with
--no-blinterp to avoid crashes. The partial support inserted in
BaselineCodeGen is purely for making this compile, but is the shape we need for
later.
Inline cache support for blinterp and baseline comes later.
Depends on D77923
Assignee | ||
Comment 9•3 years ago
|
||
Since modulo exception behaviour, the PrivateElem ops act the same as their
non-private cousins, we can recycle their IC implementations so long as we
ensure that these stubs don't attach before a throw occurs.
PrivateElements are explictly excluded from IonCompilation in this patch,
but it's worth noting that there is an approaching footgun when Ion
is enabled, caused by hoisting of idempotent caches.
The check added in IsCacheableNoProperty is insufficient to prevent
an idempotent cache from getting attached for a GetPrivateElem that is
hoisted -- as pc
is nullptr in that case.
I have added a test case here that is aimed at preventing this from
becoming an issue.
Depends on D77925
Assignee | ||
Comment 10•3 years ago
|
||
Depends on D77927
Assignee | ||
Comment 11•3 years ago
|
||
Depends on D77928
Assignee | ||
Comment 12•3 years ago
|
||
Depends on D77929
Assignee | ||
Comment 13•3 years ago
|
||
Depends on D77930
Assignee | ||
Comment 14•3 years ago
|
||
Depends on D77931
Assignee | ||
Comment 15•3 years ago
|
||
Depends on D77932
Assignee | ||
Comment 16•3 years ago
|
||
This is implemented by reusing our pre-existing lexical name tracker, the UsedNameTracker.
This particular version of the patch issues positionless errors. It is a followup
item to provide positions for errors.
Ted is a reviewer for this patch due to the interaction between the Parse world
and VM world when checking for possibly lexically-defined private names on the
scope chain.
Depends on D77933
Updated•3 years ago
|
Assignee | ||
Comment 17•3 years ago
|
||
This patch only covers the non-eval case.
Depends on D77934
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 18•3 years ago
|
||
Pushed by mgaudet@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eb7361d2c45e Private fields in non-derived classes. r=jorendorff,anba https://hg.mozilla.org/integration/autoland/rev/84c891f10d90 Add a separate scope for class body bindings. r=jorendorff https://hg.mozilla.org/integration/autoland/rev/022d942943c1 Install bindings for private names. r=jorendorff,anba https://hg.mozilla.org/integration/autoland/rev/5d046b313708 Install private name symbols in the class body scope. r=jorendorff,anba https://hg.mozilla.org/integration/autoland/rev/3b9f08b0ba80 Install private fields using the private name symbols. r=jorendorff,anba https://hg.mozilla.org/integration/autoland/rev/9a4f3aa0719c Add Basic version of getRealmConfiguration r=sfink https://hg.mozilla.org/integration/autoland/rev/510b8fa45789 Correct error in parsing of unicode private names r=jorendorff https://hg.mozilla.org/integration/autoland/rev/937d4dcd8867 Allow referencing private fields r=jorendorff https://hg.mozilla.org/integration/autoland/rev/0f884e42cf48 Inline Cache support for PrivateElem ops. r=iain https://hg.mozilla.org/integration/autoland/rev/75c34fed9983 Support optional property access r=jorendorff https://hg.mozilla.org/integration/autoland/rev/8e545f2246fa Allow adding private fields to non-extensible objects r=jorendorff https://hg.mozilla.org/integration/autoland/rev/7e30b11a3624 Correctly name anonymous private functions bound to private fields. r=jorendorff https://hg.mozilla.org/integration/autoland/rev/6cc4a63ec7f0 Make deleting a private field an error r=jorendorff https://hg.mozilla.org/integration/autoland/rev/0072a71143dc Allow dynamic access for evals r=jorendorff https://hg.mozilla.org/integration/autoland/rev/c1e5dd3607ac Allow a parse context to determine if it's in a class or not. r=tcampbell https://hg.mozilla.org/integration/autoland/rev/d2498e0b9cf6 References to PrivateIdentifiers which are not lexically present cause an early error. r=jorendorff,tcampbell
Assignee | ||
Comment 19•3 years ago
|
||
Comment 20•3 years ago
|
||
Pushed by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f139a2259e4c Fix Hazard r=BUSTAGE CLOSED TREE
Comment 21•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eb7361d2c45e
https://hg.mozilla.org/mozilla-central/rev/84c891f10d90
https://hg.mozilla.org/mozilla-central/rev/022d942943c1
https://hg.mozilla.org/mozilla-central/rev/5d046b313708
https://hg.mozilla.org/mozilla-central/rev/3b9f08b0ba80
https://hg.mozilla.org/mozilla-central/rev/9a4f3aa0719c
https://hg.mozilla.org/mozilla-central/rev/510b8fa45789
https://hg.mozilla.org/mozilla-central/rev/937d4dcd8867
https://hg.mozilla.org/mozilla-central/rev/0f884e42cf48
https://hg.mozilla.org/mozilla-central/rev/75c34fed9983
https://hg.mozilla.org/mozilla-central/rev/8e545f2246fa
https://hg.mozilla.org/mozilla-central/rev/7e30b11a3624
https://hg.mozilla.org/mozilla-central/rev/6cc4a63ec7f0
https://hg.mozilla.org/mozilla-central/rev/0072a71143dc
https://hg.mozilla.org/mozilla-central/rev/c1e5dd3607ac
https://hg.mozilla.org/mozilla-central/rev/d2498e0b9cf6
https://hg.mozilla.org/mozilla-central/rev/f139a2259e4c
Description
•