Closed
Bug 1845668
Opened 10 months ago
Closed 9 months ago
Directly use TaskController to trigger the equivalent of OffThreadCompilationCompleteRunnable
Categories
(Core :: DOM: Core & HTML, task, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
119 Branch
Tracking | Status | |
---|---|---|
firefox119 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(2 files)
Bug 1845638 is going to change the off-thread compilation/decode to directly use TaskController
task.
mozilla::dom::OffThreadCompilationCompleteRunnable is currently using Runnable
and nsIEventTarget::Dispatch
to enqueue the task, but it eventually enqueues a RunnableTask
to TaskContoller
, going through many hoops [1].
Given the depending task (compilation/decoding) is going to use Task
, it's better just directly using Task
also for OffThreadCompilationCompleteRunnable
-equivalent, and use the TaskController
's dependency management.
void ScriptLoader::OffThreadCompilationCompleteCallback(
JS::OffThreadToken* aToken, void* aCallbackData) {
...
OffThreadCompilationCompleteRunnable::Dispatch(aRunnable.forget());
static void Dispatch(
...
eventTarget->Dispatch(self.forget());
nsThread::Dispatch(already_AddRefed<nsIRunnable> aEvent, uint32_t aFlags) {
...
return mEventTarget->Dispatch(std::move(aEvent), aFlags);
ThreadEventTarget::Dispatch(already_AddRefed<nsIRunnable> aEvent,
...
if (!mSink->PutEvent(event.take(), EventQueuePriority::Normal)) {
bool PutEvent(already_AddRefed<nsIRunnable>&& aEvent,
...
return mOwner->PutEventInternal(std::move(aEvent), aPriority, this);
bool ThreadEventQueue::PutEventInternal(already_AddRefed<nsIRunnable>&& aEvent,
...
mBaseQueue->PutEvent(event.take(), aPriority, lock);
void EventQueueInternal<ItemsPerPage>::PutEvent(
...
if (mForwardToTC) {
...
tc->DispatchRunnable(event.forget(), static_cast<uint32_t>(aPriority),
manager);
void TaskController::DispatchRunnable(already_AddRefed<nsIRunnable>&& aRunnable,
...
RefPtr<RunnableTask> task = new RunnableTask(std::move(aRunnable), aPriority,
Task::Kind::MainThreadOnly);
...
TaskController::Get()->AddTask(task.forget());
Assignee | ||
Comment 1•10 months ago
|
||
Depends on D184897
Assignee | ||
Comment 2•10 months ago
|
||
Depends on D184898
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/dce19aa8ece9 Part 1: Rewrite OffThreadCompilationCompleteRunnable based on Task. r=smaug https://hg.mozilla.org/integration/autoland/rev/0b374bcf3727 Part 2: Move OffThreadCompilationCompleteTask::Run into class definition. r=smaug
Comment 4•9 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dce19aa8ece9
https://hg.mozilla.org/mozilla-central/rev/0b374bcf3727
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
status-firefox119:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•