Closed Bug 1667258 Opened 4 years ago Closed 4 years ago

Remove RealmCreationOptions::cloneSingletons

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

This is only used for a test configuration of XDR which doesn't not reflect browser behaviour. Instead we should simply disallow using non-incremental XDR on run-once scripts and a lot of complexity can be removed.

Currently only ScriptLoader/JSBC encodes run-once scripts and that uses the incremental XDR encoder which is compatible.

The JSOp::Object opcode is only for "run-once singleton contexts" which
require the run-once CompileOption to be set. We will use this invariant to
eventually remove the cloneSingletons mechanism.

Use the same conditions for EncodeScript as we do for CopyScriptImpl. This
involves checking if the top-level script was compiled as run-once. This
check applies regardless of whether the script has been run on not (which is
a stricter test than might otherwise be required). This lets us avoid the
"cloneSingletons" mechanism altogether.

This is more consistent with browser use-cases of EncodeScript which do not
mark scripts as run-once.

We change test behavior to not use the run-once flag for non-incremental
mode. Cases that are testing run-once-only features now use incremental XDR
which is consisten with what the browser actually does.

Depends on D91363

Script object-literal singletons are only generated for top-level run-once
scripts which both XDR and cloning no longer need to support. As a result,
the cloneSingletons mechanism is no longer needed and can be removed.

We can simplify the Interpreter and JITs handling of JSOp::Object to no
longer worry about cloneSingletons as a result. They also lets us remove the
setSingletonsAsValues code since we no longer have realm-wide poison bits.

Depends on D91364

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6711f01eb82f Assert that JSOp::Object is only used for run-once scripts. r=jandem https://hg.mozilla.org/integration/autoland/rev/a12dfabdb040 Disallow JS::EncodeScript on run-once scripts. r=jandem,nbp https://hg.mozilla.org/integration/autoland/rev/e0255e7ef9da Remove support for RealmCreationOptions::cloneSingletons. r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: