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


C++ VirtualRegister::numIntervals方法代码示例

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


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

示例1: beginObjectProperty

void
JSONSpewer::spewIntervals(LinearScanAllocator *regalloc)
{
    if (!fp_)
        return;

    beginObjectProperty("intervals");
    beginListProperty("blocks");

    for (size_t bno = 0; bno < regalloc->graph.numBlocks(); bno++) {
        beginObject();
        integerProperty("number", bno);
        beginListProperty("vregs");

        LBlock *lir = regalloc->graph.getBlock(bno);
        for (LInstructionIterator ins = lir->begin(); ins != lir->end(); ins++) {
            for (size_t k = 0; k < ins->numDefs(); k++) {
                VirtualRegister *vreg = &regalloc->vregs[ins->getDef(k)->virtualRegister()];

                beginObject();
                integerProperty("vreg", vreg->reg());
                beginListProperty("intervals");

                for (size_t i = 0; i < vreg->numIntervals(); i++) {
                    LiveInterval *live = vreg->getInterval(i);

                    if (live->numRanges()) {
                        beginObject();
                        property("allocation");
                        fprintf(fp_, "\"");
                        LAllocation::PrintAllocation(fp_, live->getAllocation());
                        fprintf(fp_, "\"");
                        beginListProperty("ranges");

                        for (size_t j = 0; j < live->numRanges(); j++) {
                            beginObject();
                            integerProperty("start", live->getRange(j)->from.pos());
                            integerProperty("end", live->getRange(j)->to.pos());
                            endObject();
                        }

                        endList();
                        endObject();
                    }
                }

                endList();
                endObject();
            }
        }

        endList();
        endObject();
    }

    endList();
    endObject();
}
开发者ID:mikeguidry,项目名称:mozilla-central,代码行数:58,代码来源:JSONSpewer.cpp

示例2: fprintf

void
C1Spewer::spewIntervals(FILE *fp, LinearScanAllocator *regalloc, LInstruction *ins, size_t &nextId)
{
    for (size_t k = 0; k < ins->numDefs(); k++) {
        VirtualRegister *vreg = &regalloc->vregs[ins->getDef(k)->virtualRegister()];

        for (size_t i = 0; i < vreg->numIntervals(); i++) {
            LiveInterval *live = vreg->getInterval(i);
            if (live->numRanges()) {
                fprintf(fp, "%d object \"", (i == 0) ? vreg->id() : int32_t(nextId++));
                fprintf(fp, "%s", live->getAllocation()->toString());
                fprintf(fp, "\" %d -1", vreg->id());
                for (size_t j = 0; j < live->numRanges(); j++) {
                    fprintf(fp, " [%d, %d[", live->getRange(j)->from.pos(),
                            live->getRange(j)->to.pos());
                }
                for (UsePositionIterator usePos(live->usesBegin()); usePos != live->usesEnd(); usePos++)
                    fprintf(fp, " %d M", usePos->pos.pos());
                fprintf(fp, " \"\"\n");
            }
        }
    }
}
开发者ID:birtles,项目名称:mozilla-central,代码行数:23,代码来源:C1Spewer.cpp


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