Closed Bug 1615143 Opened 2 years ago Closed 2 years ago

Combine TraceKind::Script and TraceKind::LazyScript


(Core :: JavaScript Engine, task, P1)




Tracking Status
firefox75 --- fixed


(Reporter: tcampbell, Assigned: tcampbell)




(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

Depends on D62680

Pushed by
Cleanup UBI JSScript size computation. r=jandem
Move JSScript::lazyScript / LazyScript::script_ to BaseScript. r=jandem
Eliminate TraceKind::LazyScript. r=jonco
You need to log in before you can comment on or make changes to this bug.