Skip to content

Commit 1b20111

Browse files
committed
[MERGE #6199 @MikeHolman] only tell OOP JIT about modules that have initialized localExportSlots
Merge pull request #6199 from MikeHolman:oopjitmoduleinit This leads to assert where we add the localExportSlots addr to dictionary when it is null and then try to add again when we actually initialize it (and item is unexpectedly already in dictionary). OOP JIT doesn't need to know about them until they are initialized. OS: 22218538
2 parents 90b86b5 + c9e0ff7 commit 1b20111

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

lib/Runtime/Base/ScriptContext.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5432,14 +5432,20 @@ ScriptContext::GetJitFuncRangeCache()
54325432
JITManager::HandleServerCallResult(hr, RemoteCallType::StateUpdate);
54335433
}
54345434

5435-
if (this->GetLibrary()->GetModuleRecordList())
5436-
{
5437-
this->GetLibrary()->GetModuleRecordList()->Map([this](int start, SourceTextModuleRecord* moduleRecord) {
5438-
HRESULT hr = JITManager::GetJITManager()->AddModuleRecordInfo(
5439-
m_remoteScriptContextAddr,
5440-
moduleRecord->GetModuleId(),
5441-
(intptr_t)moduleRecord->GetLocalExportSlots());
5442-
JITManager::HandleServerCallResult(hr, RemoteCallType::StateUpdate);
5435+
ModuleRecordList* moduleRecordList = this->GetLibrary()->GetModuleRecordList();
5436+
if (moduleRecordList)
5437+
{
5438+
moduleRecordList->Map([this](int start, SourceTextModuleRecord* moduleRecord) {
5439+
intptr_t exportSlotsAddr = (intptr_t)moduleRecord->GetLocalExportSlots();
5440+
// only add modules which have initialized localExportSlots
5441+
if (exportSlotsAddr)
5442+
{
5443+
HRESULT hr = JITManager::GetJITManager()->AddModuleRecordInfo(
5444+
m_remoteScriptContextAddr,
5445+
moduleRecord->GetModuleId(),
5446+
exportSlotsAddr);
5447+
JITManager::HandleServerCallResult(hr, RemoteCallType::StateUpdate);
5448+
}
54435449
});
54445450
}
54455451
}

0 commit comments

Comments
 (0)