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


C++ CCallHelpers::addLinkTask方法代码示例

本文整理汇总了C++中CCallHelpers::addLinkTask方法的典型用法代码示例。如果您正苦于以下问题:C++ CCallHelpers::addLinkTask方法的具体用法?C++ CCallHelpers::addLinkTask怎么用?C++ CCallHelpers::addLinkTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCallHelpers的用法示例。


在下文中一共展示了CCallHelpers::addLinkTask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: generateImpl

    CCallHelpers::JumpList generateImpl(AccessGenerationState& state, const RegisterSet& usedRegistersBySnippet, CCallHelpers& jit, std::index_sequence<ArgumentsIndex...>)
    {
        CCallHelpers::JumpList exceptions;
        // We spill (1) the used registers by IC and (2) the used registers by Snippet.
        AccessGenerationState::SpillState spillState = state.preserveLiveRegistersToStackForCall(usedRegistersBySnippet);

        jit.store32(
            CCallHelpers::TrustedImm32(state.callSiteIndexForExceptionHandlingOrOriginal().bits()),
            CCallHelpers::tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount)));

        jit.makeSpaceOnStackForCCall();

        jit.setupArguments<FunctionType>(std::get<ArgumentsIndex>(m_arguments)...);

        CCallHelpers::Call operationCall = jit.call(OperationPtrTag);
        auto function = m_function;
        jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
            linkBuffer.link(operationCall, FunctionPtr<OperationPtrTag>(function));
        });

        jit.setupResults(m_result);
        jit.reclaimSpaceOnStackForCCall();

        CCallHelpers::Jump noException = jit.emitExceptionCheck(state.m_vm, CCallHelpers::InvertedExceptionCheck);

        state.restoreLiveRegistersFromStackForCallWithThrownException(spillState);
        exceptions.append(jit.jump());

        noException.link(&jit);
        RegisterSet dontRestore;
        dontRestore.set(m_result);
        state.restoreLiveRegistersFromStackForCall(spillState, dontRestore);

        return exceptions;
    }
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:35,代码来源:AccessCaseSnippetParams.cpp

示例2:

Box<CCallHelpers::JumpList> ExceptionTarget::jumps(CCallHelpers& jit)
{
    Box<CCallHelpers::JumpList> result = Box<CCallHelpers::JumpList>::create();
    if (m_isDefaultHandler) {
        Box<CCallHelpers::Label> defaultHandler = m_defaultHandler;
        jit.addLinkTask(
            [=] (LinkBuffer& linkBuffer) {
                linkBuffer.link(*result, linkBuffer.locationOf(*defaultHandler));
            });
    } else {
        RefPtr<OSRExitHandle> handle = m_handle;
        jit.addLinkTask(
            [=] (LinkBuffer& linkBuffer) {
                linkBuffer.link(*result, linkBuffer.locationOf(handle->label));
            });
    }
    return result;
}
开发者ID:mjparme,项目名称:openjdk-jfx,代码行数:18,代码来源:FTLExceptionTarget.cpp

示例3: emitExitThunk

void OSRExitHandle::emitExitThunk(State& state, CCallHelpers& jit)
{
    Profiler::Compilation* compilation = state.graph.compilation();
    CCallHelpers::Label myLabel = jit.label();
    label = myLabel;
    jit.pushToSaveImmediateWithoutTouchingRegisters(CCallHelpers::TrustedImm32(index));
    CCallHelpers::PatchableJump jump = jit.patchableJump();
    RefPtr<OSRExitHandle> self = this;
    VM& vm = state.vm();
    jit.addLinkTask(
        [self, jump, myLabel, compilation, &vm] (LinkBuffer& linkBuffer) {
            self->exit.m_patchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(jump));

            linkBuffer.link(
                jump.m_jump,
                CodeLocationLabel<JITThunkPtrTag>(vm.getCTIStub(osrExitGenerationThunkGenerator).code()));
            if (compilation)
                compilation->addOSRExitSite({ linkBuffer.locationOf<JSInternalPtrTag>(myLabel) });
        });
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:20,代码来源:FTLOSRExitHandle.cpp


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