Closed Bug 1718481 Opened 3 years ago Closed 3 years ago

Rewrite nsXULPrototypeScript / nsXULPrototypeCache with stencil

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(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 arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/1cd8bdf1fc92
Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Depends on: 1694054
No longer depends on: 1694054
Depends on: 1731629
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/559a943daf25
Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Status: ASSIGNED → RESOLVED
Closed: 3 years 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) ==

Improvements:

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: https://treeherder.mozilla.org/perfherder/alerts?id=31422

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 https://bugzilla.mozilla.org/show_bug.cgi?id=703720#c0

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.

Attachment

General

Created:
Updated:
Size: