本文整理汇总了C++中StackFrame::annotation方法的典型用法代码示例。如果您正苦于以下问题:C++ StackFrame::annotation方法的具体用法?C++ StackFrame::annotation怎么用?C++ StackFrame::annotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackFrame
的用法示例。
在下文中一共展示了StackFrame::annotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Valueify
JS_GetFrameAnnotation(JSContext *cx, JSStackFrame *fpArg)
{
StackFrame *fp = Valueify(fpArg);
if (fp->annotation() && fp->scopeChain()->compartment()->principals) {
/*
* Give out an annotation only if privileges have not been revoked
* or disabled globally.
*/
return fp->annotation();
}
return NULL;
}
示例2: Valueify
JS_GetFrameAnnotation(JSContext *cx, JSStackFrame *fpArg)
{
StackFrame *fp = Valueify(fpArg);
if (fp->annotation() && fp->isScriptFrame()) {
JSPrincipals *principals = fp->scopeChain().principals(cx);
if (principals && principals->globalPrivilegesEnabled(cx, principals)) {
/*
* Give out an annotation only if privileges have not been revoked
* or disabled globally.
*/
return fp->annotation();
}
}
return NULL;
}
示例3: ReleaseAllJITCode
JS_SetTopFrameAnnotation(JSContext *cx, void *annotation)
{
StackFrame *fp = cx->fp();
JS_ASSERT_IF(fp->beginsIonActivation(), !fp->annotation());
// Note that if this frame is running in Ion, the actual calling frame
// could be inlined or a callee and thus we won't have a correct |fp|.
// To account for this, ion::InvalidationBailout will transfer an
// annotation from the old cx->fp() to the new top frame. This works
// because we will never EnterIon on a frame with an annotation.
fp->setAnnotation(annotation);
JSScript *script = fp->script();
ReleaseAllJITCode(cx->runtime->defaultFreeOp());
// Ensure that we'll never try to compile this again.
JS_ASSERT(!script->hasIonScript());
script->ion = ION_DISABLED_SCRIPT;
}