@@ -1117,6 +1117,7 @@ NativeCodeGenerator::CodeGen(PageAllocator * pageAllocator, CodeGenWorkItem* wor
11171117 }
11181118
11191119#if defined(TARGET_64)
1120+ DelayDeletingFunctionTable::Clear ();
11201121 XDataAllocation * xdataInfo = HeapNewZ (XDataAllocation);
11211122 xdataInfo->address = (byte*)jitWriteData.xdataAddr ;
11221123 XDataAllocator::Register (xdataInfo, jitWriteData.codeAddress , jitWriteData.codeSize );
@@ -3214,14 +3215,14 @@ NativeCodeGenerator::EnterScriptStart()
32143215}
32153216
32163217void
3217- FreeNativeCodeGenAllocation (Js::ScriptContext *scriptContext, Js::JavascriptMethod codeAddress, Js::JavascriptMethod thunkAddress, void ** functionTable )
3218+ FreeNativeCodeGenAllocation (Js::ScriptContext *scriptContext, Js::JavascriptMethod codeAddress, Js::JavascriptMethod thunkAddress)
32183219{
32193220 if (!scriptContext->GetNativeCodeGenerator ())
32203221 {
32213222 return ;
32223223 }
32233224
3224- scriptContext->GetNativeCodeGenerator ()->QueueFreeNativeCodeGenAllocation ((void *)codeAddress, (void *)thunkAddress, functionTable );
3225+ scriptContext->GetNativeCodeGenerator ()->QueueFreeNativeCodeGenAllocation ((void *)codeAddress, (void *)thunkAddress);
32253226}
32263227
32273228bool TryReleaseNonHiPriWorkItem (Js::ScriptContext* scriptContext, CodeGenWorkItem* workItem)
@@ -3252,30 +3253,22 @@ bool NativeCodeGenerator::TryReleaseNonHiPriWorkItem(CodeGenWorkItem* workItem)
32523253}
32533254
32543255void
3255- NativeCodeGenerator::FreeNativeCodeGenAllocation (void * codeAddress, void ** functionTable )
3256+ NativeCodeGenerator::FreeNativeCodeGenAllocation (void * codeAddress)
32563257{
32573258 if (JITManager::GetJITManager ()->IsOOPJITEnabled ())
32583259 {
3259- // function table delete in content process
3260- #if PDATA_ENABLED && defined(_WIN32)
3261- if (functionTable && *functionTable)
3262- {
3263- NtdllLibrary::Instance->DeleteGrowableFunctionTable (*functionTable);
3264- *functionTable = nullptr ;
3265- }
3266- #endif
32673260 ThreadContext * context = this ->scriptContext ->GetThreadContext ();
32683261 HRESULT hr = JITManager::GetJITManager ()->FreeAllocation (context->GetRemoteThreadContextAddr (), (intptr_t )codeAddress);
32693262 JITManager::HandleServerCallResult (hr, RemoteCallType::MemFree);
32703263 }
32713264 else if (this ->backgroundAllocators )
32723265 {
3273- this ->backgroundAllocators ->emitBufferManager .FreeAllocation (codeAddress, functionTable );
3266+ this ->backgroundAllocators ->emitBufferManager .FreeAllocation (codeAddress);
32743267 }
32753268}
32763269
32773270void
3278- NativeCodeGenerator::QueueFreeNativeCodeGenAllocation (void * codeAddress, void * thunkAddress, void ** functionTable )
3271+ NativeCodeGenerator::QueueFreeNativeCodeGenAllocation (void * codeAddress, void * thunkAddress)
32793272{
32803273 ASSERT_THREAD ();
32813274
@@ -3305,24 +3298,24 @@ NativeCodeGenerator::QueueFreeNativeCodeGenAllocation(void* codeAddress, void *
33053298 // OOP JIT will always queue a job
33063299
33073300 // The foreground allocators may have been used
3308- if (this ->foregroundAllocators && this ->foregroundAllocators ->emitBufferManager .FreeAllocation (codeAddress, functionTable ))
3301+ if (this ->foregroundAllocators && this ->foregroundAllocators ->emitBufferManager .FreeAllocation (codeAddress))
33093302 {
33103303 return ;
33113304 }
33123305
33133306 // The background allocators were used. Queue a job to free the allocation from the background thread.
3314- this ->freeLoopBodyManager .QueueFreeLoopBodyJob (codeAddress, thunkAddress, functionTable );
3307+ this ->freeLoopBodyManager .QueueFreeLoopBodyJob (codeAddress, thunkAddress);
33153308}
33163309
3317- void NativeCodeGenerator::FreeLoopBodyJobManager::QueueFreeLoopBodyJob (void * codeAddress, void * thunkAddress, void ** functionTable )
3310+ void NativeCodeGenerator::FreeLoopBodyJobManager::QueueFreeLoopBodyJob (void * codeAddress, void * thunkAddress)
33183311{
33193312 Assert (!this ->isClosed );
33203313
3321- FreeLoopBodyJob* job = HeapNewNoThrow (FreeLoopBodyJob, this , codeAddress, thunkAddress, *functionTable );
3314+ FreeLoopBodyJob* job = HeapNewNoThrow (FreeLoopBodyJob, this , codeAddress, thunkAddress);
33223315
33233316 if (job == nullptr )
33243317 {
3325- FreeLoopBodyJob stackJob (this , codeAddress, thunkAddress, *functionTable, false /* heapAllocated */ );
3318+ FreeLoopBodyJob stackJob (this , codeAddress, thunkAddress, false /* heapAllocated */ );
33263319
33273320 {
33283321 AutoOptionalCriticalSection lock (Processor ()->GetCriticalSection ());
@@ -3346,9 +3339,6 @@ void NativeCodeGenerator::FreeLoopBodyJobManager::QueueFreeLoopBodyJob(void* cod
33463339 HeapDelete (job);
33473340 }
33483341 }
3349-
3350- // function table successfully transferred to background job
3351- *functionTable = nullptr ;
33523342}
33533343
33543344#ifdef PROFILE_EXEC
0 commit comments