@@ -312,6 +312,7 @@ ServerScriptContext::IsClosed() const
312312void
313313ServerScriptContext::AddToDOMFastPathHelperMap (intptr_t funcInfoAddr, IR::JnHelperMethod helper)
314314{
315+ AutoCriticalSection cs (&m_cs);
315316 m_domFastPathHelperMap->Add (funcInfoAddr, helper);
316317}
317318
@@ -327,7 +328,7 @@ ServerScriptContext::DecommitEmitBufferManager(bool asmJsManager)
327328 GetEmitBufferManager (asmJsManager)->Decommit ();
328329}
329330
330- OOPEmitBufferManager *
331+ OOPEmitBufferManagerWithLock *
331332ServerScriptContext::GetEmitBufferManager (bool asmJsManager)
332333{
333334 if (asmJsManager)
@@ -343,11 +344,11 @@ ServerScriptContext::GetEmitBufferManager(bool asmJsManager)
343344IR::JnHelperMethod
344345ServerScriptContext::GetDOMFastPathHelper (intptr_t funcInfoAddr)
345346{
347+ AutoCriticalSection cs (&m_cs);
348+
346349 IR::JnHelperMethod helper = IR::HelperInvalid;
347350
348- m_domFastPathHelperMap->LockResize ();
349351 m_domFastPathHelperMap->TryGetValue (funcInfoAddr, &helper);
350- m_domFastPathHelperMap->UnlockResize ();
351352
352353 return helper;
353354}
@@ -392,6 +393,7 @@ ServerScriptContext::GetCodeGenAllocators()
392393Field (Js::Var)*
393394ServerScriptContext::GetModuleExportSlotArrayAddress(uint moduleIndex, uint slotIndex)
394395{
396+ AutoCriticalSection cs (&m_cs);
395397 AssertOrFailFast (m_moduleRecords.ContainsKey (moduleIndex));
396398 auto record = m_moduleRecords.Item (moduleIndex);
397399 return record->localExportSlotsAddr ;
@@ -406,6 +408,7 @@ ServerScriptContext::SetIsPRNGSeeded(bool value)
406408void
407409ServerScriptContext::AddModuleRecordInfo (unsigned int moduleId, __int64 localExportSlotsAddr)
408410{
411+ AutoCriticalSection cs (&m_cs);
409412 Js::ServerSourceTextModuleRecord* record = HeapNewStructZ (Js::ServerSourceTextModuleRecord);
410413 record->moduleId = moduleId;
411414 record->localExportSlotsAddr = (Field (Js::Var)*)localExportSlotsAddr;
0 commit comments