Closed Bug 1763645 Opened 3 years ago Closed 3 years ago

Re-enable code caching with new serialization system

Categories

(Core :: JavaScript: WebAssembly, task, P1)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox100 --- wontfix
firefox101 --- wontfix
firefox102 --- fixed

People

(Reporter: rhunt, Assigned: rhunt)

References

Details

(Keywords: sec-other, Whiteboard: [post-critsmash-triage][adv-main102-])

Attachments

(8 files)

Code caching was disabled in bug 1762619. We want to re-enable code caching with a new system for serialization.

Group: core-security → javascript-core-security
Keywords: sec-other

This commit removes all the old serialization code. The previous system
was also sort-of tied to about:memory reporting, and that's decoupled
now.

The API for Module::serialize/deserialize is also slightly reworked.
The previous ability to pass in a Metadata was needed for AsmJS (as
far as I can tell) and is not used. Additionally, the serialize
function will now resize the byte vector for you, and we no
longer expose serializedSize. Serialization is also decoupled from
submitting the bytes to the Tier2 listener.

This commit adds a feature that forces all module compilation to be serialized
and then deserialized before it can be used. The flag forces off baseline/
cranelift so that we can serialize every module.

Test directives are updated to use the flag when appropriate.

The fuzzer is also changed to define a build-id so that it can use
this feature.

Depends on D143399

This commit splits out the header fields of the stack map to
simplify serialization. The header is POD that can be serialized
separately from the trailing bitmap.

An interface for writing to a bitmap is added for deserialization.
An interface to finish collecting stackmaps without sorting is added.
The const qualification of nextInsAddr is modified.

Depends on D143400

Many data types are copied directly to/from the serialized buffer. This
is only safe if the data is "cacheable POD". This commit adds type traits
and assertions for this that will be used with the new serialization code.

A doc comment is added with the full details.

Depends on D143401

This commit re-implements the serialization code using a visitor
pattern that allows for most data structures to be serialized
with one function that can handle sizing/encoding/decoding.

A doc comment is added with the full details.

Depends on D143402

I could not find a test for this, and it's relevant for serialization.

Depends on D143403

This commit adds an assertion for tracking the size of types that
we serialize so that we can detect if they change without updating
the corresponding serialize function.

Regressions: 1767955
Group: javascript-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 3 years ago
No longer regressions: 1767955
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch

I forgot we need to do the pref-flip too. Another patch incoming.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Regressions: 1768428
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main102-]
Group: core-security-release
Depends on: 1895017
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: