mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
DLL import hotswap fixes
This commit is contained in:
parent
75e0cb9907
commit
11a46fa422
2 changed files with 22 additions and 2 deletions
|
@ -4215,6 +4215,15 @@ BfTypedValue BfExprEvaluator::CreateCall(BfMethodInstance* methodInstance, BfIRV
|
|||
mModule->mFuncReferences.TryGetValue(methodInstance, &funcCallInst);
|
||||
}
|
||||
|
||||
if ((importCallKind == BfImportCallKind_GlobalVar) &&
|
||||
(methodInstance->mHotMethod == NULL) &&
|
||||
(mModule->mCompiler->IsHotCompile()))
|
||||
{
|
||||
// This may actually be a BfImportCallKind_GlobalVar_Hot, so check it...
|
||||
mModule->CheckHotMethod(methodInstance, "");
|
||||
importCallKind = methodInstance->GetImportCallKind();
|
||||
}
|
||||
|
||||
if (importCallKind == BfImportCallKind_GlobalVar_Hot)
|
||||
{
|
||||
//TODO: Check against NULL for calling BfLoadSharedLibraries
|
||||
|
|
|
@ -18904,6 +18904,9 @@ void BfModule::CheckHotMethod(BfMethodInstance* methodInstance, const StringImpl
|
|||
#ifdef BF_DBG_HOTMETHOD_NAME
|
||||
hotMethod->mMangledName = mangledName;
|
||||
#endif
|
||||
if ((methodInstance->mMethodInstanceGroup->IsImplemented()) && (!mCompiler->IsHotCompile()))
|
||||
hotMethod->mFlags = (BfHotDepDataFlags)(hotMethod->mFlags | BfHotDepDataFlag_IsOriginalBuild);
|
||||
|
||||
methodInstance->mHotMethod = hotMethod;
|
||||
}
|
||||
}
|
||||
|
@ -19788,6 +19791,14 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
|||
return; // Bail out early for autocomplete pass
|
||||
}
|
||||
|
||||
if ((methodInstance->GetImportCallKind() != BfImportCallKind_None) && (!mBfIRBuilder->mIgnoreWrites) && (!methodInstance->mIRFunction))
|
||||
{
|
||||
BfLogSysM("DllImportGlobalVar DoMethodDeclaration processing %p\n", methodInstance);
|
||||
BfIRValue dllImportGlobalVar = CreateDllImportGlobalVar(methodInstance, true);
|
||||
methodInstance->mIRFunction = mBfIRBuilder->GetFakeVal();
|
||||
mFuncReferences[mCurMethodInstance] = dllImportGlobalVar;
|
||||
}
|
||||
|
||||
//TODO: We used to have this (this != mContext->mExternalFuncModule) check, but it caused us to keep around
|
||||
// an invalid mFuncRefernce (which came from GetMethodInstanceAtIdx) which later got remapped by the
|
||||
// autocompleter. Why did we have this check anyway?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue