Open Bug 1582160 Opened 2 years ago Updated 2 years ago

Consider allocating ScriptSource{Object} explicitly for parsing/decoding

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

People

(Reporter: jandem, Unassigned)

References

Details

Right now to parse code the embedder has to pass a CompileOptions + SourceText to one of the APIs. The frontend then allocates the ScriptSource and ScriptSourceObject at some point. All this gets more complicated with XDR and off-thread parsing/decoding.

We should consider adding an API (JS::CreateScriptSource) to create the ScriptSource{Object} explicitly, upfront (it would take the filename, lineno and other things currently stored in CompileOptions). This would shrink CompileOptions and make it much easier to reason about ScriptSource allocation.

Depends on: 1575055
See Also: → 1501608
No longer blocks: 1577280
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.