本文整理汇总了C++中ABLModulePtr::setInitCalled方法的典型用法代码示例。如果您正苦于以下问题:C++ ABLModulePtr::setInitCalled方法的具体用法?C++ ABLModulePtr::setInitCalled怎么用?C++ ABLModulePtr::setInitCalled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ABLModulePtr
的用法示例。
在下文中一共展示了ABLModulePtr::setInitCalled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execDeclaredRoutineCall
TypePtr execDeclaredRoutineCall(SymTableNodePtr routineIdPtr, bool skipOrder)
{
if(skipOrder)
{
StackItemPtr curStackFrameBase = tos;
//----------------------------------------
// Push parameter values onto the stack...
getCodeToken();
if(codeToken == TKN_LPAREN)
{
execActualParams(routineIdPtr);
getCodeToken();
}
getCodeToken();
tos = curStackFrameBase;
pushInteger(1);
return((TypePtr)(routineIdPtr->typePtr));
}
int32_t oldLevel = level; // level of caller
int32_t newLevel = routineIdPtr->level + 1; // level of callee
CallStackLevel++;
//-------------------------------------------
// First, set up the stack frame of callee...
StackItemPtr newStackFrameBasePtr = tos + 1;
bool isLibraryCall = (routineIdPtr->library && (routineIdPtr->library != CurRoutineIdPtr->library));
if(isLibraryCall)
pushStackFrameHeader(-1, -1);
else
pushStackFrameHeader(oldLevel, newLevel);
//----------------------------------------
// Push parameter values onto the stack...
getCodeToken();
if(codeToken == TKN_LPAREN)
{
execActualParams(routineIdPtr);
getCodeToken();
}
//-------------------------------------------------
// Set the return address in the new stack frame...
level = newLevel;
stackFrameBasePtr = newStackFrameBasePtr;
StackFrameHeaderPtr headerPtr = (StackFrameHeaderPtr)stackFrameBasePtr;
headerPtr->returnAddress.address = codeSegmentPtr - 1;
//---------------------------------------------------------
// If we're calling a library function, we need to set some
// module-specific info...
ABLModulePtr PrevModule = nullptr;
if(isLibraryCall)
{
PrevModule = CurModule;
CurModule = routineIdPtr->library;
CurModuleHandle = CurModule->getHandle();
if(debugger)
debugger->setModule(CurModule);
StaticDataPtr = CurModule->getStaticData();
CallModuleInit = !CurModule->getInitCalled();
CurModule->setInitCalled(true);
// routineEntry(ModuleRegistry[CurModule->getHandle()].moduleIdPtr);
}
if(ProfileLog)
{
int32_t functionStartTime = ABLGetTimeCallback();
execute(routineIdPtr);
int32_t functionExecTime = ABLGetTimeCallback() - functionStartTime;
if(functionExecTime > ProfileLogFunctionTimeLimit)
{
char s[512];
sprintf_s(s, _countof(s), "[%08d] ", NumExecutions);
for(size_t i = 0; i < CallStackLevel; i++)
strcat(s, " ");
char s1[512];
sprintf_s(s1, _countof(s1), "%s (%d)\n", routineIdPtr->name, functionExecTime);
strcat(s, s1);
ABL_AddToProfileLog(s);
}
}
else
execute(routineIdPtr);
//----------------------------------------------------------------
// If we're calling a library function, reset some module-specific
// info...
if(isLibraryCall)
{
// routineExit(ModuleRegistry[CurModule->getHandle()].moduleIdPtr);
CurModule = PrevModule;
CurModuleHandle = CurModule->getHandle();
if(debugger)
debugger->setModule(CurModule);
StaticDataPtr = CurModule->getStaticData();
}
//-------------------------------------------------------
// Return from the callee, and grab the first token after
// the return...
level = oldLevel;
getCodeToken();
CallStackLevel--;
return((TypePtr)(routineIdPtr->typePtr));
}