Closed Bug 1718102 Opened 4 years ago Closed 4 years ago

`CompilationInput::lazy` accesses should be replaced by accessors.

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: nbp, Assigned: nbp)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

The goal is to go toward the ability to parse Lazy functions without having neither a JSFunction nor a BaseScript.

By adding wrappers on CompilationInput::lazy field, the goal is to be able to abstract the BaseScript field behind something which could use a Stencil instead.

https://searchfox.org/mozilla-central/search?q=symbol:F_%3CT_js%3A%3Afrontend%3A%3ACompilationInput%3E_lazy&redirect=false

Assignee: nobody → nicolas.b.pierron
Severity: -- → N/A
Status: NEW → ASSIGNED
Type: task → enhancement
Priority: -- → P1
Blocks: 1719194

The CompilationInput currently let the consumer reach to the lazy field, to
reach accessors implemented on the BaseScript. As we are trying to remove direct
usage of the lazy field, and later abstract between a ScriptStencilExtra or a
BaseScript, we have to make it simple to add these accessors to other
structures.

This change extract the accessors and move them to a parametrized structure
which knows that its parameters is able to locate the field which contains all
these flags.

To implement accessors, on should inherit from the class
ImmutableScriptFlagsAccessors<...>

and parametrize it with the derived class as long as the derived class
implements the function

ImmutableFlags immutableFlags() const { ... }

And similarly for mutable flags, except that the returned value should be a
reference.

This change adds accessors to reach the BaseScript* lazy field as well as all
information taken from it. The intent being that most information used from the
BaseScript are taken out of the ScriptStencil and ScriptStencilExtra structures,
and that we can later use these in-place where the lazy field is used.

Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/55372527ebed Extract ScriptFlags accessors to be reused. r=arai https://hg.mozilla.org/integration/autoland/rev/be090a2e202a Abstract CompilationInput lazy fields behind accessors. r=arai

Backed out for causing bustages on JSScript.h.
Backout link
Push with failures
Failure Log

Flags: needinfo?(nicolas.b.pierron)

To satisfy clang-cl field ordering, we have to extract the
BaseScript::warmUpData_ to make it live next to the inherited GC cell which
holds the jitCodeRaw pointer.

This modification is madated by assertion which is verifying that
SelfHostedLazyScript shares the same offsets as the BaseScript for jitCodeRaw
field and the warmUpData_ field.

Attachment #9230274 - Attachment is obsolete: true
Pushed by npierron@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9f48019d06ea Extract ScriptFlags accessors to be reused. r=arai https://hg.mozilla.org/integration/autoland/rev/b4978b94e605 Abstract CompilationInput lazy fields behind accessors. r=arai
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
Flags: needinfo?(nicolas.b.pierron)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: