本文整理汇总了C++中StackFrame::addToFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ StackFrame::addToFrame方法的具体用法?C++ StackFrame::addToFrame怎么用?C++ StackFrame::addToFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackFrame
的用法示例。
在下文中一共展示了StackFrame::addToFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IntermediateData
//.........这里部分代码省略.........
delete *it; //say so long to our lovely data structure the AST
}
//Z_message("yes");
//globals have been initialized, now we repeat for the functions
for(vector<ASTFuncDecl *>::iterator it = funcs.begin(); it != funcs.end(); it++)
{
bool isarun = false;
string scriptname;
for(map<string,int>::iterator it2 = runsymbols.begin(); it2 != runsymbols.end(); it2++)
{
if(it2->second == symbols->getID(*it))
{
isarun=true;
scriptname = it2->first;
break;
}
}
vector<Opcode *> funccode;
//count the number of stack-allocated variables
vector<int> stackvars;
pair<vector<int> *, SymbolTable *> param = pair<vector<int> *, SymbolTable *>(&stackvars, symbols);
CountStackSymbols temp;
(*it)->execute(temp, ¶m);
int offset = 0;
StackFrame sf;
//if this is a run, there is the this pointer
if(isarun)
{
sf.addToFrame(thisptr[scriptname], offset);
offset += 10000;
}
//the params are now the first elements of this list
//so assign them depths in reverse order
for(vector<int>::reverse_iterator it2 = stackvars.rbegin(); it2 != stackvars.rend(); it2++)
{
sf.addToFrame(*it2, offset);
offset += 10000;
}
//start of the function
Opcode *first = new OSetImmediate(new VarArgument(EXP1), new LiteralArgument(0));
first->setLabel(lt.functionToLabel(symbols->getID(*it)));
funccode.push_back(first);
//push on the 0s
int numtoallocate = (unsigned int)stackvars.size()-(unsigned int)symbols->getFuncParams(symbols->getID(*it)).size();
for(int i = 0; i < numtoallocate; i++)
{
funccode.push_back(new OPushRegister(new VarArgument(EXP1)));
}
//push on the this, if a script
if(isarun)
{
switch(scripttypes[scriptname])
{
case ScriptParser::TYPE_FFC:
funccode.push_back(new OSetRegister(new VarArgument(EXP2), new VarArgument(REFFFC)));
break;