Add initial support for fuses.
Categories
(Core :: JavaScript Engine, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: mgaudet, Assigned: mgaudet)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [sp3])
Attachments
(8 files, 10 obsolete 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 |
- A Fuse: A data structure in memory that asserts some property of the system.
- A fuse may be popped/invalidated/burnt out; this indicates that the property the fuse was asserting no longer holds.
- There are two models of Fuse: Guard fuses are used as guards at various points through the engine to allow dynamic choice of a fallback path vs. fast path. A guard is checked explicitly before each action. In constrast, an Invalidating fuse instead performs some cleanup actions which inform various parts of the code that the assumption made no longer holds (e.g invalidating code).
I have patches I will attach that sketch out guard-fuses
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Adds the ability to have a specific object kick off a Watchtower callback on property
write to a specific NativeObject.
Assignee | ||
Comment 3•2 years ago
|
||
This also makes the design decision to -also- pop fuses on property change, which
is triggered on the property descriptor change paths.
Depends on D189282
Assignee | ||
Comment 4•2 years ago
|
||
Verify that CacheIR and the fuse agree on the optimizability of Array.prototype[@@iterator]
Depends on D189283
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D189284
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D189285
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D189286
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
|
||
Updated•2 years ago
|
Assignee | ||
Comment 9•2 years ago
|
||
A Fuse: A data structure in memory that asserts some property of the system.
-
A fuse may be popped: this indicates that the property the fuse was asserting
no longer holds. -
There are two models of Fuse: Guard fuses are used as guards at various
points through the engine to allow dynamic choice of a fallback path vs. fast
path. A guard is checked explicitly before each action. In contrast, an
Invalidating fuse instead performs some cleanup actions which inform
various parts of the code that the assumption made no longer holds (e.g
invalidating code). -
A fuse can be checked easily for validity -- a single load and compare should
suffice.
This patch only adds support for Realm scoped Guard Fuses.
In order to maintain the invariants required by fuses, Watchtower is enhanced
to support watching for property modification.
A few review notes:
-
This large patch -can- be broken up if desired; it just grew large because I
got tired of having a wonky bunch of corrections split across three different
patches. -
I originally added a number of asserts to ensure that wherever we did a
setSlot we either correctly watched for changes, or the underlying object
did not watch for changes. This ended up being a bunch of additions to
environment object paths; I would prefer to somehow assert that we never flag
an environment object for watching (at least until we want to try), but I
can't quite construct that.
Assignee | ||
Comment 10•2 years ago
|
||
This speeds up a microbenchmark like the following by 50%.
function foo(x) {
var b;
[b] = x;
return b;
}
let start = performance.now();
for (var i = 0; i < 200_000; i++) {
foo([1, 2, 3]);
}
let end = performance.now();
console.log(end - start);
Depends on D194292
Updated•2 years ago
|
Assignee | ||
Comment 11•2 years ago
|
||
Assignee | ||
Comment 12•2 years ago
|
||
Depends on D195260
Assignee | ||
Comment 13•2 years ago
|
||
Also, borrow support here for iterator prototypes in anticipation of adding fuses to ArrayIteratorPrototype
Depends on D195261
Assignee | ||
Comment 14•2 years ago
|
||
Depends on D195262
Assignee | ||
Comment 15•2 years ago
|
||
Depends on D195263
Assignee | ||
Comment 16•2 years ago
|
||
Depends on D195264
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 17•2 years ago
|
||
These fuses will be consumed when we enable fuse based optimization.
Depends on D195265
Assignee | ||
Comment 18•2 years ago
|
||
Current plan is that we'll land this bug as an 'enabling build', without consuming then we'll move forward with consumption in other bugs.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 19•2 years ago
|
||
Comment on attachment 9364833 [details]
Bug 1855301 - Use a fuse check to speed up destructuring optimization -- Landing Disabled-by-default r?jandem,iain
Revision D194293 was moved to bug 1870396. Setting attachment 9364833 [details] to obsolete.
Assignee | ||
Comment 20•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 21•2 years ago
|
||
Comment 22•2 years ago
|
||
Backed out for causing bustages at Iteration.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/32b8b208b182cc075a0a5d84eb135de321cdd31f
Failure log: https://treeherder.mozilla.org/logviewer?job_id=440612034&repo=autoland&lineNumber=39372
Comment 23•2 years ago
|
||
Assignee | ||
Comment 24•2 years ago
|
||
Fixed irksome old clang issue and attempted relanding.
Comment 25•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8483eb0f6998
https://hg.mozilla.org/mozilla-central/rev/56cc0126e3ed
https://hg.mozilla.org/mozilla-central/rev/339beb959236
https://hg.mozilla.org/mozilla-central/rev/267bec6e427c
https://hg.mozilla.org/mozilla-central/rev/7bdb688ff63b
https://hg.mozilla.org/mozilla-central/rev/2b1d14a12a9c
https://hg.mozilla.org/mozilla-central/rev/96176d302fca
https://hg.mozilla.org/mozilla-central/rev/da91b70056f1
Description
•