MCPcopy Create free account
hub / github.com/beefytech/Beef / Execute

Method Execute

IDEHelper/Compiler/CeMachine.cpp:5937–9516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5935};
5936
5937bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* startFramePtr, BfType*& returnType, BfType*& castReturnType)
5938{
5939 auto ceModule = mCeMachine->mCeModule;
5940 SetAndRestoreValue<bool> ignoreWrites(ceModule->mBfIRBuilder->mIgnoreWrites, false);
5941 CeFunction* ceFunction = startFunction;
5942 returnType = startFunction->mMethodInstance->mReturnType;
5943 uint8* memStart = &mMemory[0];
5944 int memSize = mMemory.mSize;
5945 uint8* instPtr = (ceFunction->mCode.IsEmpty()) ? NULL : &ceFunction->mCode[0];
5946 uint8* stackPtr = startStackPtr;
5947 uint8* framePtr = startFramePtr;
5948 bool needsFunctionIds = ceModule->mSystem->mPtrSize != 8;
5949 int32 ptrSize = ceModule->mSystem->mPtrSize;
5950 bool isDebugging = mCeMachine->mDebugger != NULL;
5951
5952 volatile bool* specialCheckPtr = &mCeMachine->mSpecialCheck;
5953 volatile bool* fastFinishPtr = &mCeMachine->mCompiler->mFastFinish;
5954 volatile bool* cancelingPtr = &mCeMachine->mCompiler->mCanceling;
5955
5956 auto _GetCurFrame = [&]()
5957 {
5958 CeFrame ceFrame;
5959 ceFrame.mFunction = ceFunction;
5960 ceFrame.mReturnType = returnType;
5961 ceFrame.mFrameAddr = framePtr - memStart;
5962 ceFrame.mStackAddr = stackPtr - memStart;
5963 ceFrame.mInstPtr = instPtr;
5964 return ceFrame;
5965 };
5966
5967 auto _FixVariables = [&]()
5968 {
5969 memSize = mMemory.mSize;
5970 intptr memOffset = &mMemory[0] - memStart;
5971 if (memOffset == 0)
5972 return;
5973 memStart += memOffset;
5974 stackPtr += memOffset;
5975 framePtr += memOffset;
5976 };
5977
5978 auto _DbgPause = [&]()
5979 {
5980 int itr = 0;
5981 while (mCeMachine->mDebugger != NULL)
5982 {
5983 if (mCeMachine->mDbgPaused)
5984 {
5985 // This indicates a missed breakpoint, we should try to avoid this
5986 // Re-entrancy can cause this, from populating a type during cedebugger autocomplete
5987 OutputDebugStrF("CeMachine DbgPause reentry\n");
5988 return;
5989 }
5990
5991 CePendingExpr* prevPendingExpr = NULL;
5992
5993 ///
5994 {

Callers 9

DoPopulateTypeMethod · 0.45
CallMethod · 0.45
CreateExpressionMethod · 0.45
CreateStatementMethod · 0.45
ToStringMethod · 0.45

Calls 15

FailFunction · 0.85
CeSetAddrValFunction · 0.85
DoubleToStringFunction · 0.85
FloatToStringFunction · 0.85
TryStringOutFunction · 0.85
WaitForMethod · 0.80
DoEvaluateMethod · 0.80
UpdateBreakpointsMethod · 0.80
UnbindBreakpointsMethod · 0.80
GetLatestMethod · 0.80
PopulateMemberSetsMethod · 0.80
ContainsWithMethod · 0.80

Tested by

no test coverage detected