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


C++ StackMaps::computeRecordMap方法代码示例

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


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

示例1: link

void link(CompilerState& state, const LinkDesc& desc)
{
    StackMaps sm;
    DataView dv(state.m_stackMapsSection->data());
    sm.parse(&dv);
    auto rm = sm.computeRecordMap();
    EMASSERT(state.m_codeSectionList.size() == 1);
    uint8_t* prologue = const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(state.m_codeSectionList.front().data()));
    uint8_t* body = static_cast<uint8_t*>(state.m_entryPoint);
    desc.m_patchPrologue(desc.m_opaque, prologue);
    for (auto& record : rm) {
        EMASSERT(record.second.size() == 1);
        auto found = state.m_patchMap.find(record.first);
        if (found == state.m_patchMap.end()) {
            // should be the tcg helpers.
            continue;
        }
        PatchDesc& patchDesc = found->second;
        switch (patchDesc.m_type) {
        case PatchType::Assist: {
            desc.m_patchAssist(desc.m_opaque, body + record.second[0].instructionOffset, desc.m_dispAssist);
        } break;
        case PatchType::TcgDirect: {
            auto& recordUnit = record.second[0];
            desc.m_patchTcgDirect(desc.m_opaque, body + recordUnit.instructionOffset, desc.m_dispTcgDirect);
        } break;
        case PatchType::TcgIndirect: {
            auto& recordUnit = record.second[0];
            desc.m_patchTcgIndirect(desc.m_opaque, body + recordUnit.instructionOffset, desc.m_dispTcgIndirect);
        } break;
        default:
            EMUNREACHABLE();
        }
    }
}
开发者ID:zhangzhanheng,项目名称:arm_translator,代码行数:35,代码来源:Link.cpp

示例2: link

void LLVMDisasContext::link()
{
    StackMaps sm;
    const LinkDesc desc = {
        nullptr,
        m_dispDirect,
        m_dispIndirect,
        patchProloge,
        patchDirect,
        patchIndirect,
    };
    DataView dv(state()->m_stackMapsSection->data());
    sm.parse(&dv);
    auto rm = sm.computeRecordMap();
    EMASSERT(state()->m_codeSectionList.size() == 1);
    uint8_t* prologue = state()->m_codeSectionList.front();
    uint8_t* body = static_cast<uint8_t*>(state()->m_entryPoint);
    desc.m_patchPrologue(desc.m_opaque, prologue);
    for (auto& record : rm) {
        auto found = state()->m_patchMap.find(record.first);
        if (found == state()->m_patchMap.end()) {
            // should be the tcg helpers.
            continue;
        }
        PatchDesc& patchDesc = found->second;
        switch (patchDesc.m_type) {
        case PatchType::TcgDirect: {
            for (auto& recordUnit : record.second) {
                desc.m_patchTcgDirect(desc.m_opaque, body + recordUnit.instructionOffset, desc.m_dispTcgDirect);
            }
        } break;
        case PatchType::TcgIndirect: {
            for (auto& recordUnit : record.second) {
                desc.m_patchTcgIndirect(desc.m_opaque, body + recordUnit.instructionOffset, desc.m_dispTcgIndirect);
            }
        } break;
        default:
            EMUNREACHABLE();
        }
    }
}
开发者ID:Linux-Embedded,项目名称:arm_translator,代码行数:41,代码来源:LLVMLink.cpp


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