本文整理汇总了C++中AsmJSModule::activation方法的典型用法代码示例。如果您正苦于以下问题:C++ AsmJSModule::activation方法的具体用法?C++ AsmJSModule::activation怎么用?C++ AsmJSModule::activation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsmJSModule
的用法示例。
在下文中一共展示了AsmJSModule::activation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Activation
AsmJSActivation::AsmJSActivation(JSContext *cx, AsmJSModule &module)
: Activation(cx, AsmJS),
module_(module),
entrySP_(nullptr),
profiler_(nullptr),
resumePC_(nullptr),
fp_(nullptr),
exitReason_(AsmJSExit::None)
{
(void) entrySP_; // squelch GCC warning
// NB: this is a hack and can be removed once Ion switches over to
// JS::ProfilingFrameIterator.
if (cx->runtime()->spsProfiler.enabled()) {
profiler_ = &cx->runtime()->spsProfiler;
profiler_->enterAsmJS("asm.js code :0", this);
}
prevAsmJSForModule_ = module.activation();
module.activation() = this;
prevAsmJS_ = cx->mainThread().asmJSActivationStack_;
cx->mainThread().asmJSActivationStack_ = this;
// Now that the AsmJSActivation is fully initialized, make it visible to
// asynchronous profiling.
registerProfiling();
}
示例2: lock
AsmJSActivation::AsmJSActivation(JSContext *cx, AsmJSModule &module)
: Activation(cx, AsmJS),
module_(module),
errorRejoinSP_(nullptr),
profiler_(nullptr),
resumePC_(nullptr),
fp_(nullptr),
exitReason_(AsmJSExit::None)
{
if (cx->runtime()->spsProfiler.enabled()) {
// Use a profiler string that matches jsMatch regex in
// browser/devtools/profiler/cleopatra/js/parserWorker.js.
// (For now use a single static string to avoid further slowing down
// calls into asm.js.)
profiler_ = &cx->runtime()->spsProfiler;
profiler_->enterAsmJS("asm.js code :0", this);
}
prevAsmJSForModule_ = module.activation();
module.activation() = this;
prevAsmJS_ = cx->mainThread().asmJSActivationStack_;
JSRuntime::AutoLockForInterrupt lock(cx->runtime());
cx->mainThread().asmJSActivationStack_ = this;
(void) errorRejoinSP_; // squelch GCC warning
}