Closed Bug 1718481 Opened 7 months ago Closed 4 months ago

Rewrite nsXULPrototypeScript / nsXULPrototypeCache with stencil


(Core :: JavaScript Engine, task, P3)




94 Branch
Tracking Status
firefox94 --- fixed


(Reporter: arai, Assigned: arai)




(2 files)

nsXULPrototypeScript / nsXULPrototypeCache uses JSScript as a cache for JS::CompileOffThread/JS::Compile result.
they holds the result both on memory and in file (nsIXPConnect::{ReadScript,WriteScript})

rewriting them with stencil removes JS::CloneAndExecuteScript call in PrototypeDocumentContentSink::ExecuteScript and partially unblocks bug 1662152.

JS::CloneAndExecuteScript in PrototypeDocumentContentSink::ExecuteScript always clones, so using stencil instead and instantiating there won't regress much.

Depends on: 1688788
Attachment #9233806 - Attachment description: WIP: Bug 1718481 - Use stencil in nsXULPrototypeCache. r?mgaudet! → Bug 1718481 - Use stencil in nsXULPrototypeCache. r?tcampbell!
Blocks: 1728953
Pushed by
Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Depends on: 1694054
No longer depends on: 1694054
Depends on: 1731629
Pushed by
Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Flags: needinfo?(arai.unmht)

== Change summary for alert #31422 (as of Tue, 21 Sep 2021 12:28:43 GMT) ==


Ratio Test Platform Options Absolute values (old vs new)
5% JS windows10-64-2004-shippable-qr fission tp6 244,981,923.50 -> 233,097,527.06

For up to date results, see:

Attached file test.xpi

The changes introduced in this bug cause Firefox to crash, if WebExtension Experiments flush the cash using:

Services.obs.notifyObservers(null, "startupcache-invalidate", null);

This method has been working before and is the only supported and "preferred" way to do it. See instructions given in

Crash observed on Windows 10.

Steps to reproduce:

  • Set xpinstall.signatures.required to false
  • Set extensions.experiments.enabled to true
  • Restart Firefox (to make sure the changed config is picked up)
  • Install the attached add-on
  • Wait 10 seconds
  • Disable the add-on in Add-ons Manager
  • Wait 10 seconds (until the add-on is moved to the "Disabled" section)
  • Open Hamburger Menu -> Settings/Preferences
  • Observe Firefox crash.
Regressions: 1736039

copied it to bug 1736039

No longer regressions: 1736039
You need to log in before you can comment on or make changes to this bug.