Closed Bug 1615143 Opened 5 years ago Closed 5 years ago

Combine TraceKind::Script and TraceKind::LazyScript

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(3 files)

We can break off a big piece of Bug 1529456 by first eliminating TraceKind::LazyScript. This stack of patches will still have a separate arena for lazy vs non-lazy scripts.

To achieve this, I'll add a IsLazyScript ImmutableFlag to BaseScript. Eventually this flag should be removed because scripts will transform between lazy and non-lazy form more fluidly.

Blocks: 1615145

Generalize the code to handle BaseScript types to prepare for eliminating
TraceKind::LazyScript. Also remove JSScript::sizeOfData method in favour of
the equivalent BaseScript::sizeOfExcludingThis.

This patch creates a union field in BaseScript to hold either form of
pointer. An IsLazyScript flag is added to ImmutableFlags to know which union
arm to trace. We are also able to use a single trace function for both.
IsLazyScript flag to disambiguate the union arms.

Note that this field will be removed entirely once the JSScript and
LazyScript instances are merged.

Depends on D62679

Now that JSScript and LazyScript share a trace method, we can use a single
TraceKind within the GC. To acheive this we also must remove eager marking of
LazyScripts.

Depends on D62680

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/97de2c9ab0a1 Cleanup UBI JSScript size computation. r=jandem https://hg.mozilla.org/integration/autoland/rev/06a0f1b9929e Move JSScript::lazyScript / LazyScript::script_ to BaseScript. r=jandem https://hg.mozilla.org/integration/autoland/rev/4db8bac77334 Eliminate TraceKind::LazyScript. r=jonco
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: