Skip to content

Commit c9e0ff7

Browse files
committed
only tell OOP JIT about modules that have initialized localExportSlots
1 parent 90b86b5 commit c9e0ff7

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)