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

Removed mNoSplat for GCMarkMembers, relying on CallingConvention

This commit is contained in:
Brian Fiete 2020-05-06 16:20:17 -07:00
parent b62ac83155
commit bd7a4b392f
5 changed files with 16 additions and 14 deletions

View file

@ -1972,8 +1972,8 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
auto methodDef = AddMethod(mCurTypeDef, BfMethodType_Normal, BfProtection_Protected, false, BF_METHODNAME_MARKMEMBERS);
methodDef->mIsVirtual = true;
methodDef->mIsOverride = true;
methodDef->mNoReflect = true;
methodDef->mNoSplat = true;
methodDef->mNoReflect = true;
methodDef->mCallingConvention = BfCallingConvention_Cdecl;
mCurTypeDef->mHasOverrideMethods = true;
}
}

View file

@ -4955,7 +4955,7 @@ void BfExprEvaluator::PushThis(BfAstNode* targetSrc, BfTypedValue argVal, BfMeth
if (argVal.mType->IsValuelessType())
return;
if ((!methodInstance->AllowsThisSplatting()) && (methodDef->mIsMutating))
if ((!methodInstance->AllowsThisSplatting()) || (methodDef->mIsMutating))
{
argVal = mModule->MakeAddressable(argVal);
irArgs.push_back(argVal.mValue);

View file

@ -1098,7 +1098,7 @@ void BfModule::EnsureIRBuilder(bool dbgVerifyCodeGen)
//mBfIRBuilder->mDbgVerifyCodeGen = true;
if (
(mModuleName == "-")
//|| (mModuleName == "Vec2")
//|| (mModuleName == "Raylib_Color")
//|| (mModuleName == "System_Int32")
//|| (mModuleName == "Hey_Dude_Bro_TestClass")
)
@ -15143,6 +15143,11 @@ void BfModule::EmitGCMarkValue(BfTypedValue markVal, BfModuleMethodInstance mark
if (markVal.mType != methodOwner)
markVal = Cast(NULL, markVal, methodOwner);
if (markMemberMethodInstance.mMethodInstance->mIdHash == 0x1500000236LL)
{
NOP;
}
exprEvaluator.PushThis(NULL, markVal, markMemberMethodInstance.mMethodInstance, args);
exprEvaluator.CreateCall(markMemberMethodInstance.mMethodInstance, markMemberMethodInstance.mFunc, false, args);
}
@ -15286,14 +15291,13 @@ void BfModule::ProcessMethod_SetupParams(BfMethodInstance* methodInstance, BfTyp
paramVar->mValue = mBfIRBuilder->GetArgument(argIdx);
else
paramVar->mValue = mBfIRBuilder->GetFakeVal();
if ((thisType->IsSplattable()) && (methodInstance->AllowsThisSplatting()))
{
if (!thisType->IsTypedPrimitive())
paramVar->mIsSplat = true;
}
else if (!methodDef->mIsMutating)
else if ((!methodDef->mIsMutating) && (methodInstance->mCallingConvention == BfCallingConvention_Unspecified))
paramVar->mIsLowered = thisType->GetLoweredType() != BfTypeCode_None;
auto thisTypeInst = thisType->ToTypeInstance();

View file

@ -659,7 +659,7 @@ bool BfMethodInstance::AllowsSplatting()
{
if (mCallingConvention != BfCallingConvention_Unspecified)
return false;
return !mMethodDef->mNoSplat;
return true;
}
bool BfMethodInstance::AllowsThisSplatting()
@ -949,7 +949,7 @@ void BfMethodInstance::GetIRFunctionInfo(BfModule* module, BfIRType& returnType,
{
doSplat = true;
}
else if (!mMethodDef->mIsMutating)
else if ((!mMethodDef->mIsMutating) && (mCallingConvention == BfCallingConvention_Unspecified))
checkLowered = true;
}
else

View file

@ -710,8 +710,7 @@ public:
bool mHasAppend;
bool mAlwaysInline;
bool mNoReturn;
bool mIsMutating;
bool mNoSplat;
bool mIsMutating;
bool mNoReflect;
bool mIsSkipCall;
bool mIsOperator;
@ -737,8 +736,7 @@ public:
mIsPartial = false;
mCLink = false;
mNoReturn = false;
mIsMutating = false;
mNoSplat = false;
mIsMutating = false;
mNoReflect = false;
mIsSkipCall = false;
mIsOperator = false;
@ -763,7 +761,7 @@ public:
virtual ~BfMethodDef();
static BfImportKind GetImportKindFromPath(const StringImpl& filePath);
bool HasNoThisSplat() { return mIsMutating || mNoSplat; }
bool HasNoThisSplat() { return mIsMutating; }
void Reset();
void FreeMembers();
BfMethodDeclaration* GetMethodDeclaration();