当前位置: 首页>>代码示例>>C++>>正文


C++ AsmJSModule::activation方法代码示例

本文整理汇总了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();
}
开发者ID:yati-sagade,项目名称:PerlitoMonkey,代码行数:28,代码来源:Stack.cpp

示例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
}
开发者ID:,项目名称:,代码行数:28,代码来源:


注:本文中的AsmJSModule::activation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。