Example #1
0
void Graph::dump(CodeBlock* codeBlock)
{
    for (size_t b = 0; b < m_blocks.size(); ++b) {
        BasicBlock* block = m_blocks[b].get();
        printf("Block #%u (bc#%u): %s%s\n", (int)b, block->bytecodeBegin, block->isReachable ? "" : " (skipped)", block->isOSRTarget ? " (OSR target)" : "");
        printf("  vars before: ");
        if (block->cfaHasVisited)
            dumpOperands(block->valuesAtHead, stdout);
        else
            printf("<empty>");
        printf("\n");
        printf("  var links: ");
        dumpOperands(block->variablesAtHead, stdout);
        printf("\n");
        for (size_t i = block->begin; i < block->end; ++i)
            dump(i, codeBlock);
        printf("  vars after: ");
        if (block->cfaHasVisited)
            dumpOperands(block->valuesAtTail, stdout);
        else
            printf("<empty>");
        printf("\n");
    }
    printf("Phi Nodes:\n");
    for (size_t i = m_blocks.last()->end; i < size(); ++i)
        dump(i, codeBlock);
}
Example #2
0
void Graph::dump()
{
    NodeIndex lastNodeIndex = NoNode;
    for (size_t b = 0; b < m_blocks.size(); ++b) {
        BasicBlock* block = m_blocks[b].get();
        if (!block)
            continue;
        dumpBlockHeader("", b, DumpAllPhis);
        dataLog("  vars before: ");
        if (block->cfaHasVisited)
            dumpOperands(block->valuesAtHead, WTF::dataFile());
        else
            dataLog("<empty>");
        dataLog("\n");
        dataLog("  var links: ");
        dumpOperands(block->variablesAtHead, WTF::dataFile());
        dataLog("\n");
        for (size_t i = 0; i < block->size(); ++i) {
            dumpCodeOrigin("", lastNodeIndex, block->at(i));
            dump("", block->at(i));
            lastNodeIndex = block->at(i);
        }
        dataLog("  vars after: ");
        if (block->cfaHasVisited)
            dumpOperands(block->valuesAtTail, WTF::dataFile());
        else
            dataLog("<empty>");
        dataLog("\n");
        dataLog("  var links: ");
        dumpOperands(block->variablesAtTail, WTF::dataFile());
        dataLog("\n");
    }
}
Example #3
0
    void performBlockCFA(BlockIndex blockIndex)
    {
        BasicBlock* block = m_graph.m_blocks[blockIndex].get();
        if (!block)
            return;
        if (!block->cfaShouldRevisit)
            return;
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
        dataLogF("   Block #%u (bc#%u):\n", blockIndex, block->bytecodeBegin);
#endif
        m_state.beginBasicBlock(block);
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
        dataLogF("      head vars: ");
        dumpOperands(block->valuesAtHead, WTF::dataFile());
        dataLogF("\n");
#endif
        for (unsigned i = 0; i < block->size(); ++i) {
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
            Node* node = block->at(i);
            dataLogF("      %s @%u: ", Graph::opName(node->op()), node->index());
            m_state.dump(WTF::dataFile());
            dataLogF("\n");
#endif
            if (!m_state.execute(i)) {
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
                dataLogF("         Expect OSR exit.\n");
#endif
                break;
            }
        }
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
        dataLogF("      tail regs: ");
        m_state.dump(WTF::dataFile());
        dataLogF("\n");
#endif
        m_changed |= m_state.endBasicBlock(AbstractState::MergeToSuccessors);
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
        dataLogF("      tail vars: ");
        dumpOperands(block->valuesAtTail, WTF::dataFile());
        dataLogF("\n");
#endif
    }