Closed Bug 1566803 Opened 5 years ago Closed 5 years ago

Use a common base class for JSScript / LazyScript

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(4 files)

If Bug 1566607 lands, then both LazyScript and JSScript start with jitCodeRaw_ and have about 10 common fields. We should use a common base class and try to standardize accessors, particularly for immutable/mutable flags.

This is the common base class of JSScript and LazyScript. This begins
with the common jitCodeRaw_ field which both types require to have as
first memory word of structure. Follow-up patches will move more fields
and accessors that are common to the two classes.

This is defined in gc/Marking.cpp since the eager LazyScript marking
code must match the definition.

Depends on D38503

Move various fields for source positions to BaseScript. The
lineno/column have minimal treatment because it is a larger project to
make the two more uniformly set in the frontend.

In the debugger, there is still clumsy code to access both lazy and
non-lazy scripts, but this will become simplified when the two types
fully merge.

Depends on D38505

These patches introduce the new base class and move the first 8 fields. Another patch will be needed to move the flags and their accessors but that patch bit rots quickly (largely my fault) so I want to get feedback and land the basics first.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b7a383b8d837
Add a js::BaseScript type. r=jandem
https://hg.mozilla.org/integration/autoland/rev/0f5d459e99a9
Add js::BaseScript::traceChildren. r=sfink
https://hg.mozilla.org/integration/autoland/rev/63fe9b494e4f
Move scriptSource_ to js::BaseScript. r=jandem
https://hg.mozilla.org/integration/autoland/rev/2c31acc60956
Move sourceStart, etc to js::BaseScript. r=jandem,jimb
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: