1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fixed ce dependency issue

This commit is contained in:
Brian Fiete 2021-01-01 15:33:17 -08:00
parent 06a1ea841f
commit 3b1a5fd4d6
2 changed files with 9 additions and 6 deletions

View file

@ -2620,7 +2620,7 @@ CeMachine::CeMachine(BfCompiler* compiler)
mCurFunctionId = 0;
mRevisionExecuteTime = 0;
mCurTargetSrc = NULL;
mCurCEFunction = NULL;
mPreparingFunction = NULL;
mCurModule = NULL;
mCurMethodInstance = NULL;
mCurExpectingType = NULL;
@ -3773,7 +3773,7 @@ BfIRValue CeMachine::CreateConstant(BfModule* module, uint8* ptr, BfType* bfType
CE_CHECKSTACK();
bool CeMachine::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* startFramePtr, BfType*& returnType)
{
{
mExecuteId++;
CeFunction* ceFunction = startFunction;
@ -5245,7 +5245,7 @@ bool CeMachine::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
void CeMachine::PrepareFunction(CeFunction* ceFunction, CeBuilder* parentBuilder)
{
AutoTimer autoTimer(mRevisionExecuteTime);
SetAndRestoreValue<CeFunction*> prevCEFunction(mCurCEFunction, ceFunction);
SetAndRestoreValue<CeFunction*> prevCEFunction(mPreparingFunction, ceFunction);
if (mHeap == NULL)
mHeap = new ContiguousHeap();
@ -5445,8 +5445,11 @@ 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);
if (mPreparingFunction != NULL)
{
auto curOwner = mPreparingFunction->mMethodInstance->GetOwner();
curOwner->mModule->AddDependency(methodInstance->GetOwner(), curOwner, BfDependencyMap::DependencyFlag_ConstEval);
}
bool added = false;
auto ceFunction = GetFunction(methodInstance, func, added);

View file

@ -627,7 +627,7 @@ public:
HashSet<int> mStaticCtorExecSet;
CeAppendAllocInfo* mAppendAllocInfo;
CeFunction* mCurCEFunction;
CeFunction* mPreparingFunction;
BfAstNode* mCurTargetSrc;
BfMethodInstance* mCurMethodInstance;
BfModule* mCurModule;