[webkit-changes] [WebKit/WebKit] ac3edb: [JSC] Track # of active JITPlan for compiler threa...
Yusuke Suzuki
noreply at github.com
Wed Dec 4 12:11:45 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ac3edb570f403e4e1e47bee55f610a99f9d46c38
https://github.com/WebKit/WebKit/commit/ac3edb570f403e4e1e47bee55f610a99f9d46c38
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2024-12-04 (Wed, 04 Dec 2024)
Changed paths:
M Source/JavaScriptCore/bytecode/CodeBlock.cpp
M Source/JavaScriptCore/heap/Heap.cpp
M Source/JavaScriptCore/heap/Heap.h
M Source/JavaScriptCore/jit/JITPlan.cpp
M Source/JavaScriptCore/jit/JITPlan.h
M Source/JavaScriptCore/jit/JITWorklist.cpp
M Source/JavaScriptCore/jit/JITWorklist.h
M Source/JavaScriptCore/jit/JITWorklistInlines.h
M Source/JavaScriptCore/runtime/VM.h
Log Message:
-----------
[JSC] Track # of active JITPlan for compiler thread suspension
https://bugs.webkit.org/show_bug.cgi?id=284046
rdar://140920747
Reviewed by Keith Miller.
JITWorklist is global data structure and shared by all VMs.
When GC runs on one VM, we need to suspend compiler threads in
JITWorklist since it can touch GC-managed objects. But it is possible
that no JITPlan is scheduled for GC-ing VM if there are many VMs.
In that case, we do not need to suspend and resume compiler threads.
This patch tracks # of active JITPlans for a VM. And we avoid suspending
and resuming compiler threads when we know that VM does not have any
active JITPlans.
* Source/JavaScriptCore/bytecode/CodeBlock.cpp:
(JSC::CodeBlock::checkIfOptimizationThresholdReached):
* Source/JavaScriptCore/heap/Heap.cpp:
(JSC::Heap::stopThePeriphery):
(JSC::Heap::resumeThePeriphery):
(JSC::Heap::suspendCompilerThreads):
(JSC::Heap::resumeCompilerThreads):
* Source/JavaScriptCore/heap/Heap.h:
* Source/JavaScriptCore/jit/JITPlan.cpp:
(JSC::JITPlan::JITPlan):
(JSC::JITPlan::~JITPlan):
(JSC::JITPlan::cancel):
* Source/JavaScriptCore/jit/JITPlan.h:
(JSC::JITPlan::~JITPlan): Deleted.
* Source/JavaScriptCore/jit/JITWorklist.cpp:
(JSC::JITWorklist::compilationState):
(JSC::JITWorklist::completeAllReadyPlansForVM):
(JSC::JITWorklist::completeAllPlansForVM):
(JSC::JITWorklist::cancelAllPlansForVM):
(JSC::JITWorklist::removeDeadPlans):
* Source/JavaScriptCore/jit/JITWorklist.h:
* Source/JavaScriptCore/jit/JITWorklistInlines.h:
(JSC::JITWorklist::iterateCodeBlocksForGC):
* Source/JavaScriptCore/runtime/VM.h:
(JSC::VM::changeNumberOfActiveJITPlans):
(JSC::VM::numberOfActiveJITPlans const):
Canonical link: https://commits.webkit.org/287355@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list