本文整理汇总了C++中VMFrame::GetArgument方法的典型用法代码示例。如果您正苦于以下问题:C++ VMFrame::GetArgument方法的具体用法?C++ VMFrame::GetArgument怎么用?C++ VMFrame::GetArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMFrame
的用法示例。
在下文中一共展示了VMFrame::GetArgument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doReturnNonLocal
void Interpreter::doReturnNonLocal() {
vm_oop_t result = GetFrame()->Pop();
VMFrame* context = GetFrame()->GetOuterContext();
if (!context->HasPreviousFrame()) {
VMBlock* block = static_cast<VMBlock*>(GetFrame()->GetArgument(0, 0));
VMFrame* prevFrame = GetFrame()->GetPreviousFrame();
VMFrame* outerContext = prevFrame->GetOuterContext();
vm_oop_t sender = outerContext->GetArgument(0, 0);
vm_oop_t arguments[] = {block};
popFrame();
// Pop old arguments from stack
VMMethod* method = GetFrame()->GetMethod();
long numberOfArgs = method->GetNumberOfArguments();
for (long i = 0; i < numberOfArgs; ++i)
GetFrame()->Pop();
// check if current frame is big enough for this unplanned send
// #escapedBlock: needs 2 slots, one for self, and one for the block
long additionalStackSlots = 2 - GetFrame()->RemainingStackSize();
if (additionalStackSlots > 0) {
GetFrame()->SetBytecodeIndex(bytecodeIndexGlobal);
// copy current frame into a bigger one, and replace it
SetFrame(VMFrame::EmergencyFrameFrom(GetFrame(), additionalStackSlots));
}
AS_OBJ(sender)->Send(escapedBlock, arguments, 1);
return;
}
while (GetFrame() != context) popFrame();
popFrameAndPushResult(result);
}
示例2: GetSelf
vm_oop_t Interpreter::GetSelf() const {
VMFrame* context = GetFrame()->GetOuterContext();
return context->GetArgument(0, 0);
}