Stop setting JS::TransitiveCompileOptions.deoptimizeModuleGlobalVars
Categories
(Core :: XPConnect, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox138 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
Split out from bug 1881888.
deoptimizeModuleGlobalVars was added for backward compatibility layer in the system module loader, to keep the global variable behavior match to the JSM.
Given the JSM loader and the JSM to ESM shim are going to be removed, this option is no longer necessary, but this adds another behavior difference due to XPCOM and some privileged API that allows getting strong ref from weak ref,
given that in the standard ECMAScript modules, non-exported module globals no longer have the same lifetime as the module itself.
Some system module code expects the globals to have the same lifetime as the module itself, and they use weak reference to those values to simplify the cleanup (e.g. addObserver without removeObserver).
Currently the following usage looks affected:
- nsIObserverService::addObserver with
ownsWeak=true, and wrappers around it - any other things takes
nsISupportsWeakReference ChromeUtils.nondeterministicGetWeakMapKeys
The problematic behaviors are the following:
- get strong ref from weak ref
- iterate over weak-ref-ed objects
Given the above, flipping the option can break some code (e.g. bug 1940741 ), and this need to be done carefully.
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Comment 3•1 year ago
|
||
| bugherder | ||
Comment 4•1 year ago
|
||
Backed out as requested by arai for causing Bug 1946592.
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
Updated•1 year ago
|
| Comment hidden (obsolete) |
| Assignee | ||
Comment 8•1 year ago
|
||
There was misunderstanding about the effect of deoptimizeModuleGlobalVars.
Module's varScope contains all top-level variables, including lexial variables, such as let, const, and class,
and iterating over modulepc.varScope().bindings(pc_) results in handling all of them.
We should audit all top-level variables, not only vars.
Comment 10•1 year ago
|
||
| bugherder | ||
Comment 11•1 year ago
|
||
Backed out for causing high frequency failures at browser_bannerClicking.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/6900871c5dfcdeb2e0de821f57f877b64d43bd5e
Failure log: https://treeherder.mozilla.org/logviewer?job_id=497828384&repo=autoland&lineNumber=5608
Comment 12•1 year ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/6900871c5dfc
| Assignee | ||
Updated•1 year ago
|
Comment 13•1 year ago
|
||
Comment 14•1 year ago
|
||
| bugherder | ||
Description
•