Minor bytecode optimizations for private fields
Categories
(Core :: JavaScript Engine, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: jorendorff, Assigned: jorendorff)
Details
Attachments
(3 files)
A few things could be improved at the margin:
-
We do a private brand check twice in the bytecode for
obj.#priv++
. Also affects compound assignment. But if the first brand check passes, the second will too. -
We emit
ToPropertyKey
in the bytecode forobj.#m()
, but it's a no-op since#m
is always a Symbol (the private name). -
We emit a
CheckAliasedLexical
each time we look up a private symbol, like the#m
inobj.#m()
, because it's implemented as a bogus lexical binding. But the binding can't be uninitialized; we initialize it as part of setting up the class, long before any code using the private name can actually run.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D100284
Assignee | ||
Comment 3•4 years ago
|
||
Private fields are implemented, in part, with bogus bindings like #f
or
#m.method
, stored in the class Environment, which contain the private
symbols, methods, getters, and setters for the class. Since these are not real
bindings, the spec never says to check that they are initialized. They're
always initialized as part of class setup, before they could possibly be used.
The CheckAliasedLexical instruction is, therefore, a no-op. This patch
eliminates it.
Depends on D100285
Comment 4•4 years ago
|
||
There are some r+ patches which didn't land and no activity in this bug for 2 weeks.
:jorendorff, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Comment 6•4 years ago
|
||
Backed out 5 changesets (Bug 1683746, Bug 1688025) for causing hazard bustages in Scope.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/5faded16fe407277598335d564a019dc8cfaa56c
Failure log: https://treeherder.mozilla.org/logviewer?job_id=327832728&repo=autoland&lineNumber=5408
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0920a2ae2126
https://hg.mozilla.org/mozilla-central/rev/529954587d3f
https://hg.mozilla.org/mozilla-central/rev/26fa34063dec
Updated•4 years ago
|
Description
•