Automatically tigger concurrent delazification for off-thread compilation if the option is set
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox118 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file)
Currently the concurrent delazification is triggered from ParseTask.
in order to move the off-thread compilation code to Gecko thread, the DelazifyTask or equivalent needs to be triggered from Gecko thread.
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
Given the concurrent delazification is triggered automatically inside bytecode compiler for on-main-thread compilation,
it's better aligning to it also in off-thread compilation.
| Assignee | ||
Comment 2•2 years ago
|
||
The DelazifyTask::runtime field is used in the following places:
js::CancelOffThreadDelazifycalled byJSRuntime::destroyRuntimeWaitForAllDelazifyTaskscalled byCompileGlobalScriptToStencilAndMaybeInstantiate
the query in the latter can be done with ScriptSource, given CompileGlobalScriptToStencilAndMaybeInstantiate triggers the same delazification and it knows the ScriptSource.
the query in the former cannot be done with ScriptSource, given ScriptSource isn't associated with JSRuntime.
So, if we want to cancel delazify task on JSRuntime::destroyRuntime, we'll need to pass JSRuntime pointer via JS::FrontendContext.
but given the script cache is no longer strongly associated with runtime, it's not much necessary to explicitly wait in JSRuntime::destroyRuntime.
Also, given JSRuntime::destroyRuntime purges the cache, the DelazifyTask will soon stop when the current function gets delazified.
void JSRuntime::destroyRuntime() {
...
caches().purgeStencils();
| Assignee | ||
Comment 3•2 years ago
|
||
actually, we can just cancel DelazifyTask which has no runtime when a runtime is getting destroyed.
| Assignee | ||
Comment 4•2 years ago
|
||
Depends on D184357
Updated•2 years ago
|
Comment 6•2 years ago
|
||
| bugherder | ||
Description
•