1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed const eval dependency issues

This commit is contained in:
Brian Fiete 2020-12-31 11:31:19 -08:00
parent fa65029dfa
commit 86b5e65015
9 changed files with 82 additions and 22 deletions

View file

@ -2630,6 +2630,7 @@ CeMachine::CeMachine(BfCompiler* compiler)
mCurFunctionId = 0;
mRevisionExecuteTime = 0;
mCurTargetSrc = NULL;
mCurCEFunction = NULL;
mCurModule = NULL;
mCurMethodInstance = NULL;
mCurExpectingType = NULL;
@ -5243,6 +5244,7 @@ bool CeMachine::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
void CeMachine::PrepareFunction(CeFunction* ceFunction, CeBuilder* parentBuilder)
{
AutoTimer autoTimer(mRevisionExecuteTime);
SetAndRestoreValue<CeFunction*> prevCEFunction(mCurCEFunction, ceFunction);
if (mHeap == NULL)
mHeap = new ContiguousHeap();
@ -5441,7 +5443,10 @@ CeFunction* CeMachine::GetPreparedFunction(BfMethodInstance* methodInstance)
}
void CeMachine::QueueMethod(BfMethodInstance* methodInstance, BfIRValue func)
{
{
auto curOwner = mCurCEFunction->mMethodInstance->GetOwner();
curOwner->mModule->AddDependency(methodInstance->GetOwner(), curOwner, BfDependencyMap::DependencyFlag_ConstEval);
bool added = false;
auto ceFunction = GetFunction(methodInstance, func, added);
}
@ -5738,5 +5743,7 @@ BfTypedValue CeMachine::Call(BfAstNode* targetSrc, BfModule* module, BfMethodIns
mStaticFieldMap.Clear();
mHeap->Clear(BF_CE_MAX_CARRYOVER_HEAP);
module->AddDependency(methodInstance->GetOwner(), module->mCurTypeInstance, BfDependencyMap::DependencyFlag_ConstEval);
return returnValue;
}