mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Fixed HotTypeVersion base type dependency
This commit is contained in:
parent
9062662ffb
commit
2f6484894e
1 changed files with 27 additions and 24 deletions
|
@ -4489,42 +4489,45 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mCompiler->mOptions.mAllowHotSwapping) &&
|
if (mCompiler->mOptions.mAllowHotSwapping)
|
||||||
(typeInstance->mDefineState < BfTypeDefineState_HasInterfaces_Direct) &&
|
|
||||||
(typeInstance->mDefineState != BfTypeDefineState_ResolvingBaseType))
|
|
||||||
{
|
{
|
||||||
if (typeInstance->mHotTypeData == NULL)
|
if (typeInstance->mDefineState < BfTypeDefineState_HasInterfaces_Direct)
|
||||||
{
|
{
|
||||||
typeInstance->mHotTypeData = new BfHotTypeData();
|
if (typeInstance->mHotTypeData == NULL)
|
||||||
BfLogSysM("Created HotTypeData %p created for type %p in DoPopulateType\n", typeInstance->mHotTypeData, typeInstance);
|
{
|
||||||
|
typeInstance->mHotTypeData = new BfHotTypeData();
|
||||||
|
BfLogSysM("Created HotTypeData %p created for type %p in DoPopulateType\n", typeInstance->mHotTypeData, typeInstance);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear any unused versions (if we have errors, etc)
|
||||||
|
if (mCompiler->mHotState != NULL)
|
||||||
|
typeInstance->mHotTypeData->ClearVersionsAfter(mCompiler->mHotState->mCommittedHotCompileIdx);
|
||||||
|
else
|
||||||
|
BF_ASSERT(typeInstance->mHotTypeData->mTypeVersions.IsEmpty()); // We should have created a new HotTypeData when rebuilding the type
|
||||||
|
|
||||||
|
BfHotTypeVersion* hotTypeVersion = new BfHotTypeVersion();
|
||||||
|
hotTypeVersion->mTypeId = typeInstance->mTypeId;
|
||||||
|
hotTypeVersion->mDeclHotCompileIdx = mCompiler->mOptions.mHotCompileIdx;
|
||||||
|
if (mCompiler->IsHotCompile())
|
||||||
|
hotTypeVersion->mCommittedHotCompileIdx = -1;
|
||||||
|
else
|
||||||
|
hotTypeVersion->mCommittedHotCompileIdx = 0;
|
||||||
|
hotTypeVersion->mRefCount++;
|
||||||
|
typeInstance->mHotTypeData->mTypeVersions.Add(hotTypeVersion);
|
||||||
|
|
||||||
|
BfLogSysM("BfHotTypeVersion %p created for type %p\n", hotTypeVersion, typeInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear any unused versions (if we have errors, etc)
|
auto hotTypeVersion = typeInstance->mHotTypeData->mTypeVersions.back();
|
||||||
if (mCompiler->mHotState != NULL)
|
|
||||||
typeInstance->mHotTypeData->ClearVersionsAfter(mCompiler->mHotState->mCommittedHotCompileIdx);
|
|
||||||
else
|
|
||||||
BF_ASSERT(typeInstance->mHotTypeData->mTypeVersions.IsEmpty()); // We should have created a new HotTypeData when rebuilding the type
|
|
||||||
|
|
||||||
BfHotTypeVersion* hotTypeVersion = new BfHotTypeVersion();
|
|
||||||
hotTypeVersion->mTypeId = typeInstance->mTypeId;
|
|
||||||
if (typeInstance->mBaseType != NULL)
|
if (typeInstance->mBaseType != NULL)
|
||||||
{
|
{
|
||||||
if (typeInstance->mBaseType->mHotTypeData != NULL)
|
if (typeInstance->mBaseType->mHotTypeData != NULL)
|
||||||
hotTypeVersion->mBaseType = typeInstance->mBaseType->mHotTypeData->GetLatestVersion();
|
hotTypeVersion->mBaseType = typeInstance->mBaseType->mHotTypeData->GetLatestVersion();
|
||||||
else
|
else if (populateType >= BfPopulateType_Interfaces_All)
|
||||||
{
|
{
|
||||||
AssertErrorState();
|
AssertErrorState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hotTypeVersion->mDeclHotCompileIdx = mCompiler->mOptions.mHotCompileIdx;
|
|
||||||
if (mCompiler->IsHotCompile())
|
|
||||||
hotTypeVersion->mCommittedHotCompileIdx = -1;
|
|
||||||
else
|
|
||||||
hotTypeVersion->mCommittedHotCompileIdx = 0;
|
|
||||||
hotTypeVersion->mRefCount++;
|
|
||||||
typeInstance->mHotTypeData->mTypeVersions.Add(hotTypeVersion);
|
|
||||||
|
|
||||||
BfLogSysM("BfHotTypeVersion %p created for type %p\n", hotTypeVersion, typeInstance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BF_ASSERT(!typeInstance->mNeedsMethodProcessing);
|
BF_ASSERT(!typeInstance->mNeedsMethodProcessing);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue