Closed Bug 1530412 Opened 2 years ago Closed 2 years ago

Add LazyScriptData type instead of void* field


(Core :: JavaScript Engine, enhancement, P1)




Tracking Status
firefox68 --- fixed


(Reporter: tcampbell, Assigned: tcampbell)




(7 files)

Currently LazyScript has a |void* table_| field to store optional variable-length data. We should migrate to a better encapsulated structure to simplify initialization/XDR/cloning/GC issues, similar to what was done with PrivateScriptData.

The numClosedOverBindings/numInnerFunctions/fieldInitializers fields should all be moved over to this data structure.

Moving the numClosedOverBindings length to LazyScriptData would be a slight memory regression, but it is also desirable to standardize the flags of LazyScript to match JSScript. Moving the fieldInitializers stuff to LazyScriptData will make it optional and revert some of the memory regression that that change causes.

Simplify placeholders and add toStringEnd argument.

Depends on D23398

Depends on D23402

Depends on D23403

Attachment #9050804 - Attachment description: Bug 1530412 - Clean up LazyScript::CreateForXDR → Bug 1530412 - Add toStringEnd argument to LazyScript::CreateForXDR
Pushed by
Fix LazyScript constructor argument names r=jorendorff
Add toStringEnd argument to LazyScript::CreateForXDR r=jorendorff
Move LazyScript::numClosedOverBindings/numInnerFunctions to normal fields r=jorendorff
Use mozilla::Span for LazyScript tables r=jorendorff
Use JSScript::ImmutableFlags in LazyScript r=jandem
Add js::LazyScriptData type r=jorendorff
Use LazyScriptData for LazyScript r=jorendorff
You need to log in before you can comment on or make changes to this bug.