Fix return register optimization in v table call
This commit is contained in:
parent
04b10bb04d
commit
6ff2409596
|
@ -16064,7 +16064,7 @@ InterCodeProcedure::InterCodeProcedure(InterCodeModule * mod, const Location & l
|
||||||
mInterrupt(false), mHardwareInterrupt(false), mCompiled(false), mInterruptCalled(false), mDynamicStack(false),
|
mInterrupt(false), mHardwareInterrupt(false), mCompiled(false), mInterruptCalled(false), mDynamicStack(false),
|
||||||
mSaveTempsLinkerObject(nullptr), mValueReturn(false), mFramePointer(false),
|
mSaveTempsLinkerObject(nullptr), mValueReturn(false), mFramePointer(false),
|
||||||
mCheckUnreachable(true), mReturnType(IT_NONE), mCheapInline(false),
|
mCheckUnreachable(true), mReturnType(IT_NONE), mCheapInline(false),
|
||||||
mDeclaration(nullptr), mGlobalsChecked(false)
|
mDeclaration(nullptr), mGlobalsChecked(false), mDispatchedCall(false)
|
||||||
{
|
{
|
||||||
mID = mModule->mProcedures.Size();
|
mID = mModule->mProcedures.Size();
|
||||||
mModule->mProcedures.Push(this);
|
mModule->mProcedures.Push(this);
|
||||||
|
|
|
@ -602,6 +602,7 @@ public:
|
||||||
int mTempSize, mCommonFrameSize, mCallerSavedTemps, mFreeCallerSavedTemps, mFastCallBase;
|
int mTempSize, mCommonFrameSize, mCallerSavedTemps, mFreeCallerSavedTemps, mFastCallBase;
|
||||||
bool mLeafProcedure, mNativeProcedure, mCallsFunctionPointer, mHasDynamicStack, mHasInlineAssembler, mCallsByteCode, mFastCallProcedure;
|
bool mLeafProcedure, mNativeProcedure, mCallsFunctionPointer, mHasDynamicStack, mHasInlineAssembler, mCallsByteCode, mFastCallProcedure;
|
||||||
bool mInterrupt, mHardwareInterrupt, mCompiled, mInterruptCalled, mValueReturn, mFramePointer, mDynamicStack;
|
bool mInterrupt, mHardwareInterrupt, mCompiled, mInterruptCalled, mValueReturn, mFramePointer, mDynamicStack;
|
||||||
|
bool mDispatchedCall;
|
||||||
bool mCheckUnreachable;
|
bool mCheckUnreachable;
|
||||||
GrowingInterCodeProcedurePtrArray mCalledFunctions;
|
GrowingInterCodeProcedurePtrArray mCalledFunctions;
|
||||||
bool mCheapInline;
|
bool mCheapInline;
|
||||||
|
|
|
@ -4266,6 +4266,7 @@ InterCodeGenerator::ExValue InterCodeGenerator::TranslateExpression(Declaration*
|
||||||
Declaration* dinit = exp->mLeft->mLeft->mDecValue->mValue->mDecValue->mParams;
|
Declaration* dinit = exp->mLeft->mLeft->mDecValue->mValue->mDecValue->mParams;
|
||||||
while (dinit)
|
while (dinit)
|
||||||
{
|
{
|
||||||
|
proc->mModule->mProcedures[dinit->mValue->mDecValue->mVarIndex]->mDispatchedCall = true;
|
||||||
proc->AddCalledFunction(proc->mModule->mProcedures[dinit->mValue->mDecValue->mVarIndex]);
|
proc->AddCalledFunction(proc->mModule->mProcedures[dinit->mValue->mDecValue->mVarIndex]);
|
||||||
dinit = dinit->mNext;
|
dinit = dinit->mNext;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40993,7 +40993,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
|
||||||
mEntryBlock->mTrueJump = CompileBlock(mInterProc, mInterProc->mBlocks[0]);
|
mEntryBlock->mTrueJump = CompileBlock(mInterProc, mInterProc->mBlocks[0]);
|
||||||
mEntryBlock->mBranch = ASMIT_JMP;
|
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 1
|
||||||
if (proc->mParamVars.Size() == 1 && proc->mParamVars[0]->mSize == 1)
|
if (proc->mParamVars.Size() == 1 && proc->mParamVars[0]->mSize == 1)
|
||||||
|
|
Loading…
Reference in New Issue