Skip to content

Commit 9cb7e8c

Browse files
committed
[MERGE #5387 @MikeHolman] don't create background allocators for OOP JIT
Merge pull request #5387 from MikeHolman:codegenclose Aside from being useless, this can cause slowdown during NativeCodeGenerator::Close, since we call `DelayDeletingFunctionTable::Clear` when cleaning up the allocator, which is an expensive process that would otherwise be called from a background thread. OS: 17334521
2 parents 317a8ba + 64fad11 commit 9cb7e8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Backend/NativeCodeGenerator.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ void SetProfileMode(BOOL fSet);
138138

139139
InProcCodeGenAllocators *EnsureForegroundAllocators(PageAllocator * pageAllocator)
140140
{
141+
Assert(!JITManager::GetJITManager()->IsOOPJITEnabled());
141142
if (this->foregroundAllocators == nullptr)
142143
{
143144
this->foregroundAllocators = CreateAllocators(pageAllocator);
@@ -178,7 +179,10 @@ void SetProfileMode(BOOL fSet);
178179

179180
virtual void ProcessorThreadSpecificCallBack(PageAllocator * pageAllocator) override
180181
{
181-
AllocateBackgroundAllocators(pageAllocator);
182+
if (!JITManager::GetJITManager()->IsOOPJITEnabled())
183+
{
184+
AllocateBackgroundAllocators(pageAllocator);
185+
}
182186
}
183187

184188
static ExecutionMode PrejitJitMode(Js::FunctionBody *const functionBody);

0 commit comments

Comments
 (0)