本文整理汇总了C++中JSScript::lastPC方法的典型用法代码示例。如果您正苦于以下问题:C++ JSScript::lastPC方法的具体用法?C++ JSScript::lastPC怎么用?C++ JSScript::lastPC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSScript
的用法示例。
在下文中一共展示了JSScript::lastPC方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: si
bool
DebugEpilogue(JSContext* cx, BaselineFrame* frame, jsbytecode* pc, bool ok)
{
// If Debugger::onLeaveFrame returns |true| we have to return the frame's
// return value. If it returns |false|, the debugger threw an exception.
// In both cases we have to pop debug scopes.
ok = Debugger::onLeaveFrame(cx, frame, ok);
// Unwind to the outermost scope and set pc to the end of the script,
// regardless of error.
ScopeIter si(cx, frame, pc);
UnwindAllScopesInFrame(cx, si);
JSScript* script = frame->script();
frame->setOverridePc(script->lastPC());
if (frame->isNonEvalFunctionFrame()) {
MOZ_ASSERT_IF(ok, frame->hasReturnValue());
DebugScopes::onPopCall(frame, cx);
} else if (frame->isStrictEvalFrame()) {
MOZ_ASSERT_IF(frame->hasCallObj(), frame->scopeChain()->as<CallObject>().isForEval());
DebugScopes::onPopStrictEvalScope(frame);
}
if (!ok) {
// Pop this frame by updating jitTop, so that the exception handling
// code will start at the previous frame.
JitFrameLayout* prefix = frame->framePrefix();
EnsureExitFrame(prefix);
cx->runtime()->jitTop = (uint8_t*)prefix;
return false;
}
// Clear the override pc. This is not necessary for correctness: the frame
// will return immediately, but this simplifies the check we emit in debug
// builds after each callVM, to ensure this flag is not set.
frame->clearOverridePc();
return true;
}