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


C++ Opnd::getRuntimeInfo方法代码示例

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


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

示例1: handleInst_Call

PeepHoleOpt::Changed PeepHoleOpt::handleInst_Call(Inst* inst)
{
    assert(inst->getMnemonic() == Mnemonic_CALL);
    CallInst* callInst = (CallInst*)inst;
    unsigned targetOpndIndex = callInst->getTargetOpndIndex();
    Opnd* targetOpnd = callInst->getOpnd(targetOpndIndex);
    Opnd::RuntimeInfo* ri = targetOpnd->getRuntimeInfo();
    Opnd::RuntimeInfo::Kind rt_kind = Opnd::RuntimeInfo::Kind_Null;
    if (ri != NULL) {
        rt_kind = ri->getKind();
    }

    if (Opnd::RuntimeInfo::Kind_InternalHelperAddress == rt_kind) {
        return handleInst_InternalHelperCall(inst, ri);
    }
    return Changed_Nothing;
}
开发者ID:unitedroad,项目名称:harmony-for-haiku,代码行数:17,代码来源:Ia32PeepHole.cpp

示例2: extractAddrOfConst

const void* OpndUtils::extractAddrOfConst(const Opnd* op)
{
    if (op->getMemOpndKind() != MemOpndKind_ConstantArea) {
        return NULL;
    }
    // Actually, it's currently only works for IA-32 - I expect 
    // the address of constant completely in the displacement.
    // On Intel64, the address already get loaded into a register, 
    // so more complicated analysis needed to find the proper constant
    Opnd* disp = op->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement);
    if (disp == NULL) {
        // Perhaps, it's IA-32?
        return NULL;
    }
    
    Opnd::RuntimeInfo* rtInfo = disp->getRuntimeInfo();
    assert(rtInfo != NULL);
    assert(rtInfo->getKind() == Opnd::RuntimeInfo::Kind_ConstantAreaItem);
    ConstantAreaItem* item = (ConstantAreaItem*)rtInfo->getValue(0);
    // At this point we must have the address...
    assert(item->getValue()!= NULL);
    return item->getValue();
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例3: instMustHaveBCMapping

//All CALL insts except some special helpers that never cause stacktrace printing
bool InstUtils::instMustHaveBCMapping(Inst* inst) {
    if (!inst->hasKind(Inst::Kind_CallInst)) {
        return false;
    }
    CallInst* callInst = (CallInst*)inst;
    Opnd * targetOpnd=callInst->getOpnd(callInst->getTargetOpndIndex());
    Opnd* immOpnd = OpndUtils::findImmediateSource(targetOpnd);
    Opnd::RuntimeInfo * ri = immOpnd ? immOpnd->getRuntimeInfo() : NULL;
    if(!ri) {
        return true;
    } else if (ri->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress) { 
        return false;
    } else if (ri->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress) { 
        VM_RT_SUPPORT helperId = (VM_RT_SUPPORT)(POINTER_SIZE_INT)ri->getValue(0);
        switch (helperId) {
            case VM_RT_GC_GET_TLS_BASE:
            case VM_RT_GC_SAFE_POINT:
                return false;
            default:
                break;
        }
    }
    return true;
}
开发者ID:,项目名称:,代码行数:25,代码来源:


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