Skip to content
Permalink
Browse files

[MERGE #6199 @MikeHolman] only tell OOP JIT about modules that have i…

…nitialized 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
  • Loading branch information...
MikeHolman committed Jul 10, 2019
2 parents 90b86b5 + c9e0ff7 commit 1b20111e73964862752674ab4a1e72009eec9a18
Showing with 14 additions and 8 deletions.
  1. +14 −8 lib/Runtime/Base/ScriptContext.cpp
@@ -5432,14 +5432,20 @@ ScriptContext::GetJitFuncRangeCache()
JITManager::HandleServerCallResult(hr, RemoteCallType::StateUpdate);
}

if (this->GetLibrary()->GetModuleRecordList())
{
this->GetLibrary()->GetModuleRecordList()->Map([this](int start, SourceTextModuleRecord* moduleRecord) {
HRESULT hr = JITManager::GetJITManager()->AddModuleRecordInfo(
m_remoteScriptContextAddr,
moduleRecord->GetModuleId(),
(intptr_t)moduleRecord->GetLocalExportSlots());
JITManager::HandleServerCallResult(hr, RemoteCallType::StateUpdate);
ModuleRecordList* moduleRecordList = this->GetLibrary()->GetModuleRecordList();
if (moduleRecordList)
{
moduleRecordList->Map([this](int start, SourceTextModuleRecord* moduleRecord) {
intptr_t exportSlotsAddr = (intptr_t)moduleRecord->GetLocalExportSlots();
// only add modules which have initialized localExportSlots
if (exportSlotsAddr)
{
HRESULT hr = JITManager::GetJITManager()->AddModuleRecordInfo(
m_remoteScriptContextAddr,
moduleRecord->GetModuleId(),
exportSlotsAddr);
JITManager::HandleServerCallResult(hr, RemoteCallType::StateUpdate);
}
});
}
}

0 comments on commit 1b20111

Please sign in to comment.
You can’t perform that action at this time.