Skip to content
Permalink
Browse files

only tell OOP JIT about modules that have initialized localExportSlots

  • Loading branch information...
MikeHolman committed Jul 10, 2019
1 parent 90b86b5 commit c9e0ff7b78094da5668b56a9f43d601a9d0866e8
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 c9e0ff7

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