Fix return register optimization in v table call

This commit is contained in:
drmortalwombat 2023-08-20 09:26:26 +02:00
parent 04b10bb04d
commit 6ff2409596
4 changed files with 4 additions and 2 deletions

View File

@ -16064,7 +16064,7 @@ InterCodeProcedure::InterCodeProcedure(InterCodeModule * mod, const Location & l
mInterrupt(false), mHardwareInterrupt(false), mCompiled(false), mInterruptCalled(false), mDynamicStack(false),
mSaveTempsLinkerObject(nullptr), mValueReturn(false), mFramePointer(false),
mCheckUnreachable(true), mReturnType(IT_NONE), mCheapInline(false),
mDeclaration(nullptr), mGlobalsChecked(false)
mDeclaration(nullptr), mGlobalsChecked(false), mDispatchedCall(false)
{
mID = mModule->mProcedures.Size();
mModule->mProcedures.Push(this);

View File

@ -602,6 +602,7 @@ public:
int mTempSize, mCommonFrameSize, mCallerSavedTemps, mFreeCallerSavedTemps, mFastCallBase;
bool mLeafProcedure, mNativeProcedure, mCallsFunctionPointer, mHasDynamicStack, mHasInlineAssembler, mCallsByteCode, mFastCallProcedure;
bool mInterrupt, mHardwareInterrupt, mCompiled, mInterruptCalled, mValueReturn, mFramePointer, mDynamicStack;
bool mDispatchedCall;
bool mCheckUnreachable;
GrowingInterCodeProcedurePtrArray mCalledFunctions;
bool mCheapInline;

View File

@ -4266,6 +4266,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
Declaration* dinit = exp->mLeft->mLeft->mDecValue->mValue->mDecValue->mParams;
while (dinit)
{
proc->mModule->mProcedures[dinit->mValue->mDecValue->mVarIndex]->mDispatchedCall = true;
proc->AddCalledFunction(proc->mModule->mProcedures[dinit->mValue->mDecValue->mVarIndex]);
dinit = dinit->mNext;
}

View File

@ -40993,7 +40993,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
mEntryBlock->mTrueJump = CompileBlock(mInterProc, mInterProc->mBlocks[0]);
mEntryBlock->mBranch = ASMIT_JMP;
if (proc->mLeafProcedure && proc->mFastCallProcedure && !proc->mInterrupt && mNoFrame && mStackExpand == 0 && commonFrameSize == 0 && (mGenerator->mCompilerOptions & COPT_NATIVE))
if (proc->mLeafProcedure && proc->mFastCallProcedure && !proc->mInterrupt && !proc->mDispatchedCall && mNoFrame && mStackExpand == 0 && commonFrameSize == 0 && (mGenerator->mCompilerOptions & COPT_NATIVE))
{
#if 1
if (proc->mParamVars.Size() == 1 && proc->mParamVars[0]->mSize == 1)