59 : pCurCtx(Contexts - 1), pCurVal(Values - 1)
69 uint32_t tDirectExecTotal;
76 bool IsProfiling() {
return fProfiling; }
77 void StopProfiling() { fProfiling=
false; }
99 void CheckOverflow(
int iCnt)
102 throw C4AulExecError(
"value stack overflow, probably due to too deep recursion");
105 void PushInt(int32_t i)
108 (++pCurVal)->SetInt(i);
111 void PushBool(
bool b)
114 (++pCurVal)->SetBool(
b);
120 (++pCurVal)->SetString(Str);
126 (++pCurVal)->SetArray(Array);
132 (++pCurVal)->SetFunction(Fn);
138 (++pCurVal)->SetPropList(PropList);
141 void PushValue(
const C4Value &rVal)
144 (++pCurVal)->Set(rVal);
147 void PushNullVals(
int iCnt)
155 assert (LocalValueStackSize() >= 1);
160 void PopValues(
int n)
162 assert (LocalValueStackSize() >= n);
167 void PopValuesUntil(
C4Value *pUntilVal)
169 assert (pUntilVal >= Values - 1);
170 while (pCurVal > pUntilVal)
174 int ContextStackSize()
const
176 return pCurCtx - Contexts + 1;
179 int ValueStackSize()
const
181 return pCurVal - Values + 1;
184 int LocalValueStackSize()
const
186 return ContextStackSize()
188 : pCurVal - Values + 1;
194 C4Value *pPar1 = pCurVal - 1, *pPar2 = pCurVal;
200 if (!pPar2->CheckParConversion(Type2))
202 opname, pPar2->GetTypeName(), GetC4VName(Type2)).getData());
242 uint32_t tProfileTime;
244 bool operator < (
const Entry &e2)
const {
return tProfileTime < e2.tProfileTime ; }
248 std::vector<Entry> Times;
254 static void ResetTimes();
const int MAX_CONTEXT_STACK
const int MAX_VALUE_STACK
bool operator<(const C4TimeMilliseconds &lhs, const C4TimeMilliseconds &rhs)
const char * GetC4VName(const C4V_Type Type)
StdStrBuf FormatString(const char *szFmt,...)
void ClearPointers(C4Object *)
static bool FnLogCallStack(C4PropList *_this)
C4AulScriptContext * GetContext(int iLevel)
C4Value DirectExec(C4PropList *p, const char *szScript, const char *szContext, bool fPassErrors=false, C4AulScriptContext *context=nullptr, bool parse_function=false)
C4Value Exec(C4AulScriptFunc *pSFunc, C4PropList *p, C4Value pPars[], bool fPassErrors)
static C4String * FnTranslate(C4PropList *_this, C4String *text)
int GetContextDepth() const
static void StopProfiling()
static void StartProfiling(C4ScriptHost *pScript)
int GetParCount() const override
static C4TimeMilliseconds Now()
ALWAYS_INLINE bool CheckConversion(C4V_Type vtToType) const
ALWAYS_INLINE bool CheckParConversion(C4V_Type vtToType) const
const char * GetTypeName() const
const char * getData() const
void dump(StdStrBuf Dump=StdStrBuf(""))
StdStrBuf ReturnDump(StdStrBuf Dump=StdStrBuf(""))