Open Bug 1582160 Opened 5 years ago Updated 25 days ago

Consider allocating ScriptSource{Object} explicitly for parsing/decoding

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

People

(Reporter: jandem, Unassigned)

References

(Blocks 1 open bug)

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
Severity: normal normal → S3 S3
Blocks: sm-frontend
Severity: S3 → N/A
You need to log in before you can comment on or make changes to this bug.